data types of aliases
Date: Wed, 06 Nov 2002 22:18:59 GMT
Message-ID: <mzgy9.180$uwT2.9896074_at_news2.randori.com>
Hi,
For eg., I have a table T(x int, y float). My application generates queries
like the ones
Query 1: select CAST(2 as int) as alias1, T.x as alias2, T.y as alias3 where
I use OCI calls to determine the data type and the values of alias1, alias2
The problem arises when I try to categorise alias1 as an integer in Query 1
Thanks,
given below.
Query 2: select CAST(2.0 as float) as alias1, T.x as alias2, T.y as alias3
where T.y > 0;
Oracle treats alias1, alias2 and alias3 as SQLT_NUM type. Based on the scale
and precision
returned by the OCIAttrGet() call, I have to categorize alias1, alias2 or
alias3
as either an INTEGER, FLOAT or a DECIMAL.
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, namely,
alias2 and alias3 (which helps me to properly figure the datatypes of alias2
and alias3).
Is there anything I can do to properly find the datatype of alias1??
Sashi
Received on Wed Nov 06 2002 - 23:18:59 CET