神秘的getClobVal() [英] The mystic getClobVal()
问题描述
我有一个表(AKADMIN),表中有一个XMLTYPE列,名称为XML.我想在此列中使用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' ;
在结果集中,前4列为CLOB类型,而第五列为XMLTYPE.我必须在getClobVal()之后键入任何注释或别名以更正结果的(CLOB)类型.为什么?
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' ;
它抛出一个 ORA-00904字符串:无效的标识符
嗯...
有人有什么主意吗?
有关环境的附加信息:Oracle Database 11g企业版11.2.0.4.0版;PL/SQL Developer 10.0.5.1710
Addition info about environment: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0; PL/SQL Developer 10.0.5.1710
但是在我们通过OJDBC6进行的Java复制中尝试了此方法,
But a tried this in our Java apllication via OJDBC6 with same results
推荐答案
您应将xml放在方括号中:
You should put xml in a brackets:
select (xml).getClobVal() from akadmin;
为我工作
这篇关于神秘的getClobVal()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!