|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
trouble with number(p,s) data type.
hi!
im using oracle8 and im having trouble using the number() data type. i just cant make sense of vat im doing wrong. can anyone explain vat p and s (precision and scale...as it says in my book) mean in number(p,s) data type? suppose i have a column GPA. i need 1 digit before the decimal point and (say) 2 digit after the decimal point (for extra precision) because GPA cannot have higher value than 4.0 ie gpa number(1,2) then inserting value 3.45 gives this msg: ORA-01438: value larger than specified precision allows for this column so i alter the table: gpa number(2,1) now that i insert 3.45, it rounds it off to 3.5, WHY? so just to give it a try, i insert value 4.32 in gpa (not a valid GPA...but anyway) and upon selecting...it give 4.3 WHAT IS GOING ON HERE? can anyone explain plz? also, can anyone plz tell me what are the maximum number of columns i can create in one table? |
|
#2
|
|||
|
|||
|
According to
http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/sql_elements2a.htm#45723 You should use number(3,2) Quote:
But anyway, I never reached this limit, the table with the highest number of columns I have seen was something like 50-60 columns, but that was poor DB design anyway (and I can't think of any example were having more then 50 columns would make sens) |
|
#3
|
|||
|
|||
|
thanx shammat!! its all clear now!
|
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > trouble with number(p,s) data type. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|