Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The mystic getClobVal()

I have a table (AKADMIN) with an XMLTYPE column which name is XML. I would like to use the getClobVal() with this column.

select t.xml.getClobVal() /**/ 
,      t.xml.getClobVal() --
,      t.xml.getClobVal() as clobval
,      t.xml.getClobVal()
from akadmin t where ROWID = 'AAAQc6AAIAAAADDAAA' ;

In the resultset the first 4 column give CLOB type, but the fifth column XMLTYPE. I have to type any comment or alias after getClobVal() to correct (CLOB) type of the result. Why?

Another issue, when I leave the alias of tablename:

select xml.getClobVal()
from akadmin t where ROWID = 'AAAQc6AAIAAAADDAAA' ;

It throws an ORA-00904 string: invalid identifier Hmmm...

Does anybody have any idea?

Addition info about environment: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0; PL/SQL Developer 10.0.5.1710

But a tried this in our Java apllication via OJDBC6 with same results

like image 881
m_and_m Avatar asked Dec 15 '22 19:12

m_and_m


1 Answers

You should put xml in a brackets:

select (xml).getClobVal() from akadmin;

works for me

like image 156
user3378876 Avatar answered Jan 12 '23 13:01

user3378876