Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Contractors
#11
(Feb-06-2017, 10:08 AM)Ofnuts Wrote: Technically, they are. Adding two of these doesn't yield an interesting result. They are just strings restricted to contain only digits, like postal codes and phone numbers. This doesn't mean they can't have proper code to retrieve them...

Well, this is true. If they had had something to handle the sorting and it wouldn't have been too much of a problem, within that one database. Really, putting a leading 0 in would have solved most of the problems, although it would have been a conceptual shift for the analysts to remember that '132' is now '0132'. The thing that gets me about it is that the did have numeric product codes in the new database. For the numeric ID on that table the created a whole new set of numeric codes, and then put the old numeric ID in as a string.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply
#12
That is a problem, I agree,
I constantly ran across this problem when working in the telecommunications industry
I was constantly complaining about the use of text fields for non textual data.

I couldn't justify the cost of conversion from one state to the other.
However, text is the native format for relational database columns or fields, so I
did understand where the government folks were coming from.

In my own data, I used indexed flat files for my own work.
The index was a hash into the actual data (which was always binary)

When it became necessary to deal with sorting text based files, the usual solution
was to pre-process the text file, creating a secondary file that contained two fields.

The first would be all of the sort keys in the order of precedence, and the second
being an offset into the original file (the physical location of the text record).

I would then sort the index file.
A copy of the original was made by reading the sorted records in sequence.

This is a very expensive and only temporary solution (as the input data must be frozen during the process).

The index is then discarded.
Reply
#13
I almost never worked with databases and thanks to this thread now I know how to avoid some issues in the future. I'll need it
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#14
Actually the solution that I am showing here are just flat files.
The database mention was only to explain one of the reasons
numeric fields were saved as text. Another of coarse would be to
have files that could be viewed with plain text editors.

I rarely used this method, unless the files were being created for some
others requirements
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020