Number format in Oracle SQL -
i've given task of exporting data oracle view fixed length text file, i've been given specification of how data should exported text file. i.e.
quantity num (10) price num (8,2) participant_id char (3) brokerage num (10,2) cds_fees num (8,2)
my confusion arises in numeric types when says (8,2). if i'm use same text, means
10 characters (as to_char(<field name>, '9999999.99'))
or
8 characters (as to_char(<field name>, '99999.99'))
when exporting fixed length text field in text file?
i looking @ question gave insight, not entirely.
appreciate if enlighten me examples.
thanks lot.
according oracle docs on types
optionally, can specify precision (total number of digits) , scale (number of digits right of decimal point):
if precision not specified, column stores values given. if no scale specified, scale zero.
so in case, number(8,2)
, has got:
- 8 digits in total
- 2 of after decimal point
this gives range of -999999.99
999999.99
Comments
Post a Comment