Hi everyone
I'm using ORACLE 11g and looking to shred XML into a test table called employees. I was hoping I'd be able to get the datatypes from the existing employees table instead of specifying them in the columns clause. Is this possible?
Here is an example of what I'm trying to do. But, I get an error:
PL/SQL: ORA-00907: missing right parenthesis on the line with starting with columns.
insert into EMPLOYEES
select *
from xmltable(
'/employees/employee'
passing EMP_XML
columns FIRST_NAME EMPLOYEES.FIRST_NAME%TYPE path 'first_name',
LAST_NAME EMPLOYEES.LAST_NAME%TYPE path 'last_name',
GENDER EMPLOYEES.GENDER%TYPE path 'gender',
AGE EMPLOYEES.AGE%TYPE path 'age'
);
Error Details
columns FIRST_NAME EMPLOYEES.FIRST_NAME%TYPE path 'first_name',
*
ERROR at line 16:
ORA-06550: line 16, column 42:
PL/SQL: ORA-00907: missing right parenthesis
ORA-06550: line 11, column 5:
PL/SQL: SQL Statement ignored
Thanks.