Page 1 of 1
XMLTYPE as an object attribute?
Posted: Tue 05 Feb 2008 15:22
by MarkF
Hi Folks!
Does ODAC support XMLTYPE as an object attribute? For example:
Code: Select all
TYPE PATIENT AS OBJECT (
ID NUMBER(38),
LAST_NAME VARCHAR(200),
FIRST_NAME VARCHAR(200),
MEDHIST XMLTYPE
);
I get ORA-04043: object "SCOTT"."XMLTYPE" does not exist if I query a table with the above object.
Thanks for any help!
-Mark
Posted: Wed 06 Feb 2008 08:34
by Plash
ODAC does not support objects with XMLTYPE attribute.
Posted: Wed 06 Feb 2008 13:28
by MarkF
Thanks. Is there any plan to support this? Alternately, could the xmltype attribute either be bound as a string, or could the error message be changed?
-Mark
Posted: Thu 07 Feb 2008 12:16
by Plash
This error message is shown because OCI returns incorrect schema for XMLTYPE attribute (SCOTT instead of SYS). So ODAC cannot distinguish between user object named XMLTYPE and SYS.XMLTYPE.
A XMLTYPE attribute cannot be bound as string except the case when you cast the attribute to string in your SELECT statement.
Posted: Thu 07 Feb 2008 13:21
by MarkF
Thanks for the info. In this case, could the schema be ignored if you see a type of XMLTYPE? Is it possible to create a new type named XMLTYPE? It might be better to just work around the problem (as it seems SQLPlus does.)
Thanks,
-Mark
Posted: Fri 08 Feb 2008 10:06
by Plash
It is possible to create a user's type named XMLTYPE. We can ignore the schema. But that is not enough because there are also the problems with reading a value from XMLTYPE attribute.
The only known way to do this is to convert the value to CLOB by executing an additional query to the database for each XMLTYPE value.
We'll consider possibility to add this functionality in one of the future ODAC versions.