Page 1 of 1

Oracle 9.2.0.5 Data Type Problem

Posted: Thu 15 Mar 2007 14:34
by A. Jose
Hi

I have a problem with a union VIEW, I post the example:

create table T1
(
DATE1 NUMBER(8)
);


create table T2
(
DATE1 NUMBER(8)
);


The description of both tables:

SQL> desc t1
Name Type Nullable Default Comments
----- --------- -------- ------- --------
DATE1 NUMBER(8) Y

SQL> desc t2
Name Type Nullable Default Comments
----- --------- -------- ------- --------
DATE1 NUMBER(8) Y

And the union View

CREATE OR REPLACE VIEW VIEW_1 AS
SELECT
CAST (NVL(T1.DATE1,T2.DATE1) AS NUMBER(8)) AS DATE1_WITH_CAST,
NVL(T1.DATE1,T2.DATE1) AS DATE1_WITHIN_CAST,
T1.DATE1 AS DATE1_T1,
T2.DATE1 AS DATE1_T2
FROM TABLE1 T1,TABLE2 T2
WHERE T1.DATE1 = T2.DATE1


The description of the view:

SQL> DESC T1_T2
Name Type Nullable Default Comments
----------------- --------- -------- ------- --------
DATE1_WITH_CAST NUMBER(8) Y
DATE1_WITHIN_CAST NUMBER Y
DATE1_T1 NUMBER(8) Y
DATE1_T2 NUMBER(8) Y

Well the problem is what i have created a TOraQuery with the view and DATE1_WITH_CAST should be TIntegerField and ODAC says that is a FloatField.

Thank you for the posible advice

Posted: Fri 16 Mar 2007 09:42
by Plash
See discussion in the following thread
http://www.crlab.com/forums/viewtopic.php?t=1016