dbTalk Databases Forums  

Numeric & Character datatype query

comp.databases comp.databases


Discuss Numeric & Character datatype query in the comp.databases forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Ian
 
Posts: n/a

Default Numeric & Character datatype query - 07-22-2004 , 08:58 PM






Can anyone advise me if there is a standard rule of thumb used for the
storage of numeric data with a particular datatype? For example, numeric
data which is used in a calculation (e.g. phone number, health card number,
etc) - is the preferred method to store as a character rather than numeric?

There are still some dinosaur systems in place and I have a task to extract
data from a Pick based system (in which everything is stored as text) and
upload it to an Oracle database. The vast majority of my experience has
been interacting with the Pick database so I guess that makes me a bit of a
dinosaur also.

Many thanks for your responses.

Regards,
Ian



Reply With Quote
  #2  
Old   
Ian
 
Posts: n/a

Default Re: Numeric & Character datatype query - 07-22-2004 , 09:00 PM






I should have proof-read this before hitting the send button. I should have
said "For example, numeric data which is NOT used in a calculation..."




"Ian" <ian_stephenson(@)hotmail.com> wrote

Quote:
Can anyone advise me if there is a standard rule of thumb used for the
storage of numeric data with a particular datatype? For example, numeric
data which is used in a calculation (e.g. phone number, health card
number,
etc) - is the preferred method to store as a character rather than
numeric?

There are still some dinosaur systems in place and I have a task to
extract
data from a Pick based system (in which everything is stored as text) and
upload it to an Oracle database. The vast majority of my experience has
been interacting with the Pick database so I guess that makes me a bit of
a
dinosaur also.

Many thanks for your responses.

Regards,
Ian





Reply With Quote
  #3  
Old   
Gene Wirchenko
 
Posts: n/a

Default Re: Numeric & Character datatype query - 07-22-2004 , 10:25 PM



"Ian" <ian_stephenson(@)hotmail.com> wrote:

Quote:
Can anyone advise me if there is a standard rule of thumb used for the
storage of numeric data with a particular datatype? For example, numeric
data which is used in a calculation (e.g. phone number, health card number,
etc) - is the preferred method to store as a character rather than numeric?
Later correction with "not" noted. Yes. I use it.

One good reason, is that, too often, "number" gets used when the
quantity is not a number. ISBNs can have X in them. Phone numbers
typically have punctuation. And on and on.

Quote:
There are still some dinosaur systems in place and I have a task to extract
data from a Pick based system (in which everything is stored as text) and
upload it to an Oracle database. The vast majority of my experience has
been interacting with the Pick database so I guess that makes me a bit of a
dinosaur also.
Tell yourself that you are helping make the dinosaurs extinct?

Quote:
Many thanks for your responses.
You are welcome.

Sincerely,

Gene Wrichenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.


Reply With Quote
  #4  
Old   
Laconic2
 
Posts: n/a

Default Re: Numeric & Character datatype query - 07-23-2004 , 06:26 AM



Distinguishing between a "number" and a "string of digits" can get to be a
bit of a philosophical exercise. Those of us who grew up writing numbers on
paper are used to using strings of digits to represent numbers, and we tend
to think of them as the same thing.

If you want to keep it practical, I suggest you look at it from three
points of view:

First, the data requirements. Don't make the domain of your data so
restrictive that you can't store what you need. Example:
if you have a data item called "zip_code", but it's used for Canadian postal
codes, you can't make it a number.

Second, ease of use: If the application language doesn't deal well with a
data type, or spends excessive time converting datatypes, you might want
to consider a different data type. Since Pick integrates the programming
environment and the data storage environment, this hasn't been an issue for
you before. It may not be an issue now.

Third, convenience inside the database. Some RDBMS systems make better use
of numeric indexes than of character string indexes. Time efficiency is
probably more important than space efficiency, but you know better than I
do what's important in your environment.

Finally, look at your RDBMS to see how hard it is to change your mind later.
In the best of all cases, you can change the datatype on the fly, and the
system will do any necessary conversions for applications that are already
out there.



"Ian" <ian_stephenson(@)hotmail.com> wrote

Quote:
Can anyone advise me if there is a standard rule of thumb used for the
storage of numeric data with a particular datatype? For example, numeric
data which is used in a calculation (e.g. phone number, health card
number,
etc) - is the preferred method to store as a character rather than
numeric?

There are still some dinosaur systems in place and I have a task to
extract
data from a Pick based system (in which everything is stored as text) and
upload it to an Oracle database. The vast majority of my experience has
been interacting with the Pick database so I guess that makes me a bit of
a
dinosaur also.

Many thanks for your responses.

Regards,
Ian





Reply With Quote
  #5  
Old   
Karl A. Krueger
 
Posts: n/a

Default Re: Numeric & Character datatype query - 07-23-2004 , 01:09 PM



Laconic2 <laconic2 (AT) comcast (DOT) net> wrote:
Quote:
Distinguishing between a "number" and a "string of digits" can get to be a
bit of a philosophical exercise. Those of us who grew up writing numbers on
paper are used to using strings of digits to represent numbers, and we tend
to think of them as the same thing.
One way to discern whether a datum is a quantity or just a bunch of
figures is to ask: Would this datum mean the same thing if I were to
write it in hexadecimal?

For instance, if I record a temperature as 37 degrees (in decimal), that
37 means the same thing as hexadecimal 25. But if my phone number is
4139877654, it doesn't make any sense to say this is hex F6C18516.

--
Karl A. Krueger <kkrueger (AT) example (DOT) edu>
Woods Hole Oceanographic Institution
Email address is spamtrapped. s/example/whoi/
"Outlook not so good." -- Magic 8-Ball Software Reviews


Reply With Quote
  #6  
Old   
Gene Wirchenko
 
Posts: n/a

Default Re: Numeric & Character datatype query - 07-23-2004 , 05:29 PM



"Karl A. Krueger" <kkrueger (AT) example (DOT) edu> wrote:

Quote:
Laconic2 <laconic2 (AT) comcast (DOT) net> wrote:
Distinguishing between a "number" and a "string of digits" can get to be a
bit of a philosophical exercise. Those of us who grew up writing numbers on
paper are used to using strings of digits to represent numbers, and we tend
to think of them as the same thing.

One way to discern whether a datum is a quantity or just a bunch of
figures is to ask: Would this datum mean the same thing if I were to
write it in hexadecimal?

For instance, if I record a temperature as 37 degrees (in decimal), that
37 means the same thing as hexadecimal 25. But if my phone number is
4139877654, it doesn't make any sense to say this is hex F6C18516.
You know you are a computer nerd when...
...you verify the above conversion to hexadecimal.

Gene "Guilty as Charged" Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.


Reply With Quote
  #7  
Old   
Lemming
 
Posts: n/a

Default Re: Numeric & Character datatype query - 07-23-2004 , 07:37 PM



On Fri, 23 Jul 2004 15:29:40 -0700, Gene Wirchenko
<genew (AT) mail (DOT) ocis.net> wrote:

Quote:
"Karl A. Krueger" <kkrueger (AT) example (DOT) edu> wrote:

Laconic2 <laconic2 (AT) comcast (DOT) net> wrote:
Distinguishing between a "number" and a "string of digits" can get to be a
bit of a philosophical exercise. Those of us who grew up writing numbers on
paper are used to using strings of digits to represent numbers, and we tend
to think of them as the same thing.

One way to discern whether a datum is a quantity or just a bunch of
figures is to ask: Would this datum mean the same thing if I were to
write it in hexadecimal?

For instance, if I record a temperature as 37 degrees (in decimal), that
37 means the same thing as hexadecimal 25. But if my phone number is
4139877654, it doesn't make any sense to say this is hex F6C18516.

You know you are a computer nerd when...
...you verify the above conversion to hexadecimal.
If you mean you verified in your head that 37 decimal = 25 hex, then I
agree. If you mean that you verified that 4139877654 decimal =
F6C18516 hex then I think that's more than nerd and is getting into
.... well, let's not go there, ok?

Quote:
Gene "Guilty as Charged" Wirchenko
Like I said ... let's not go there.

Lemming
--
Curiosity *may* have killed Schrodinger's cat.


Reply With Quote
  #8  
Old   
Laconic2
 
Posts: n/a

Default Re: Numeric & Character datatype query - 07-24-2004 , 07:37 AM




"Gene Wirchenko" <genew (AT) mail (DOT) ocis.net> wrote

Quote:
You know you are a computer nerd when...
...you verify the above conversion to hexadecimal.
When Parts of Digital Equipment Corporation began to be sold off ten years
ago, my comment was..

732777964





Reply With Quote
  #9  
Old   
Gene Wirchenko
 
Posts: n/a

Default Re: Numeric & Character datatype query - 07-26-2004 , 10:06 AM



Lemming <thiswillbounce (AT) bumblbee (DOT) demon.co.uk> wrote:

Quote:
On Fri, 23 Jul 2004 15:29:40 -0700, Gene Wirchenko
genew (AT) mail (DOT) ocis.net> wrote:
[snip]

Quote:
You know you are a computer nerd when...
...you verify the above conversion to hexadecimal.

If you mean you verified in your head that 37 decimal = 25 hex, then I
agree. If you mean that you verified that 4139877654 decimal =
Trivial.

Quote:
F6C18516 hex then I think that's more than nerd and is getting into
... well, let's not go there, ok?
Oops.

Quote:
Gene "Guilty as Charged" Wirchenko

Like I said ... let's not go there.

Lemming
--
Curiosity *may* have killed Schrodinger's cat.
Let us check that, too. Here, kitty, kitty.

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.