The mystic getClobVal()

怎甘沉沦 提交于 2021-01-27 11:56:24

问题


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


回答1:


You should put xml in a brackets:

select (xml).getClobVal() from akadmin;

works for me



来源:https://stackoverflow.com/questions/26465260/the-mystic-getclobval

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!