Execution of xquery with sql prompt(oracle 11g)
Hi All I am executing the following query with squl prompt:
SELECT XMLQuery('xquery version "1.0"; (: :)
declare default element namespace "eNodeB"; (: :)
for $m in ora:tokenize('oracle~','~')
return ($m)'
RETURNING CONTENT) AS RESULT
FROM DUAL;
But its giving the following exception
for $m in ora:tokenize('deepa~','~')
*
ERROR at line 3:
ORA-19109: RETURNING keyword expected
2) With the below mentioned query
SELECT XMLQuery('xquery version "1.0"; (: :)
declare default element namespace "eNodeB"; (: :)
for $x in $eNodeBRef/eNodeBFile/eNodeB/eNodeBTop[eNodeBTopIndex='1']
for $m in ora:tokenize('eNodeBTopAttr1~','~')
let $r:=$x/following-sibling::*[local-name(.)=$m]
where (exists($x/*[local-name(.)=$m]) or exists($r))
return (
if(exists($r) and not(exists($x/*[local-name(.)=$m]))) then
element{local-name($r)}{data($r)} else(), if(exists($x/*[local-na
me(.)=$m])) then element{local-name($x/*[local-name(.)=$m])}{data($x/*[local-name(.)=$m])} else()' PASSING p.OBJECT_VALUE AS
"eNodeBRef"
RETURNING CONTENT) AS RESULT
FROM A_ENODEB p
WHERE
existsNode(p.OBJECT_VALUE,
'/eNodeBFile/fileHeader[@fileName="eNodeB_inst_1.xml"=1;
its giving the below error while executing through sql prompt
*for $x in $eNodeBRef/eNodeBFile/eNodeB/eNodeBTop[eNodeBTopIndex='1']
*
ERROR at line 3:
ORA-19109: RETURNING keyword expected*