I'd like to read a XML using XMLTABLE but I would like my PATH be a varchar2 instead of a string. I'm trying to do it but I'm getting the error "ORA-01780: string literal required"
Example:
path1 VARCHAR2(100); path2 VARCHAR2(100); path3 VARCHAR2(100); path4 VARCHAR2(100); begin path1 :='persons/employees/emp'; path2 :='persons/employees/name'; path3 :='persons/employees/job'; path4 :='persons/employees/hire'; SELECT xt.* FROM xml_tab x, XMLTABLE('/company/person' PASSING x.xml_data COLUMNS "EMPNO" VARCHAR2(4) PATH path1, "ENAME" VARCHAR2(10) PATH path2, "JOB" VARCHAR2(9) PATH path3, "HIREDATE" VARCHAR2(11) PATH path4 ) xt; Does anyone knows if there is any way to use a varchar2 variable type after PATH instaead of writing the path directly?
No comments:
Post a Comment