when executing an union query in oracle 10g and 11g.
-- Failed in 796 ms with error: ORA-01790: expression must have same datatype as corresponding expression
A first chance exception of type 'System.Data.Entity.Core.EntityCommandExecutionException' occurred in mscorlib.dll
checked the sql, there are 2 fields causing the error.
Table 1 Fields
Field 1 Type nvarchar2(32 char)
Field 2 Type clob (ssdl type) (long dbType)
corresponding nullable fields generated for table 2.
Field 1 Type TO_CHAR(NULL)
Field 2 Type TO_CLOB(NULL)
Code: Select all
CREATE TABLE "SYSADM"."TEST1"
( "CLOB_COL" CLOB,
"LONG_COL" LONG,
"VARCHAR_COL" NVARCHAR2(32)
)
SELECT CLOB_COL, VARCHAR_COL FROM TEST1
UNION
SELECT TO_CLOB(NULL) , TO_CHAR(NULL) AS C2 FROM TEST1
thanks
Anand.