I am trying to insert data into oracle 9i temp tables using the following style. but getting error as
ERROR at line 3
ORA-00933 SQL command not properly ended
Please assist me.
INSERT INTO emp (empname,empno)
FROM XMLTABLE (
PASSING xmltype (BFILENAME ('test_dir', 'emp.xml'), NLS_CHARSET_ID ('CHAR_CS'))
COLUMNS empname VARCHAR (30) path 'empname',
empno VARCHAR (30) path 'empno')
MY emp.xml is
<?xml version="1.0" encoding="AR8ISO8859P6"?>
Oracle version: 8i - 9.0.x.x
There was no option that I can recall or could find. All the parsing of XML that I've done in 8i was via the xmldom package.
Oracle version: 9.2.x.x - 10.1.x.x
This is were Oracle introduced extract, extractValue and TABLE(XMLSequence(extract())) for dealing with repeating nodes.
Oracle version: 10.2.x.x
Oracle introduced XMLTable as a replacement for the previous methods since it could handle all three methods for extracting data from XML. At that point, Oracle stopped enhancing extract/extractValue in terms of performance and focused on XMLTable. In 10.2.0.1 and .2, XMLTable was implemented via Java and in .3 it was moved into the kernel so performance from .3 onwards should be better than the older 9.2 / 10.1 methods. If not, feel free to open a ticket with Oracle support. Apparently Oracle also introduced XMLQuery as well but I've never heard of many using that in 10.2
from Methods to parse XML per Oracle version
so use correct way for your oracle version