Home > Archive > Oracle certifications > January 2003 > About Basic SQL...





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author About Basic SQL...
Ian Poon

2003-01-03, 1:12 pm

Dear Experts,
Would you please explain the Datatype of NUMBER(5,-2)?
Example:
Value 1234567 - result? why?

Thanks,
Ian
melissa4

2003-01-06, 8:09 am

The datatype of number(p,s) is precision, scale. In your example Oracle will round the number to 2 places to the left of the decimal place, meaning the number that will get returned is 1234600. If the number was positive say number(5, 2) you can insert numbers up to two decimal places.
Here is a great link for information on datatypes in Oracle:


http://download-west.oracle.com/doc...nts2a.htm#45443

Hope this helps!
Ian Poon

2003-01-06, 9:44 am

Thanks for your kindly help!
Just that simple
infimacs

2003-01-09, 3:28 am

NUMBER datatype is specified as NUMBER(P, S) whereby:
P = Precision (how many digits bef the decimal)
S = Scale (how many digits aft decimal)
Eg NUMBER(3,2) can store upto a value of 999.99

The negative indicate a negative scale
Eg NUMBER (3,-2) can store upto a value of 999.99-

ROUND and TRUNC functions with negative values affect the results dramatically
Look up docs.oracle.com

Surf around Oracle site and you would realise that there are quite a good resource available. If you are taking a class, check up the answer with your lecturer and pay attention to ROUND and TRUNC with negative numbers
Sponsored Links





Free Braindumps | MCSE braindumps software forum

Copyright 2003 - 2008 examnotes.net