How to declare array in xpath query using oracle

66 Views Asked by At

I am trying to create an array in XPath query using oracle, but it is treating as a string, below is the code snippet, can someone please help me where I am doing wrong.

XMLQUERY('    
let $vals :=
    if (count($Cntnt/emp/emp_content/emp_part)=1) then 
      ("1") 
    else if (count($Cntnt/emp/emp_content/emp_part)=2) then 
      ("00","01","10","11")
    else if (count($Cntnt/emp/emp_content/emp_part)==3) then
      ("111","110","101","100","011","010","001","000")
    else()

      for $val in $vals
        return concat ($val,"")
      ' 
PASSING emp_xml AS "Cntnt" RETURNING CONTENT).getStringVal() as tst.
0

There are 0 best solutions below