Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> What does zero precision and scale mean for Oracle number type
hi there,
I have a peculiar problem. My client application generates dynamic SQL
whenever
new updates enter the system, like the ones given below:
T(x int, y float)
Query 1: select CAST(2 as int) as alias1, T.x as alias2, T.y as alias3 where
T.x > 0;
Query 2: select CAST(2 as float) as alias1, T.x as alias2, T.y as alias3
where T.y > 0;
I use OCI calls to determine the data type and the the values of alias1,
alias2 and alias3.
Oracle treats alias1, alias2 and alias3 as SQLT_NUM type. Based on the scale
and precision
returned by the OCIAttrGet() call, I categorise alias1, alias2 and alias3 as
either an INTEGER,
FLOAT or a DECIMAL (with a fixed precision and scale).
The problem arises when I try to categorise alias1 as an integer in Query 1
and alias1 as a
float in Query 2. OCIAttrGet() returns 0 for both scale and precision for
alias1 in both
the queries whereas it returns the proper scale and precision for other
attributes like
alias2 and alias3 (which helps me to properly figure out the datatypes of
alias2 and alias3).
Is there anything I can do to properly find the datatype of alias1??
regards,
sashi
Received on Wed Oct 03 2001 - 18:43:18 CDT
![]() |
![]() |