1

What should be the control file to load below 2 formats of XML . If there is any data then i will receive first format with open and close tag

<NAME>OTC</NAME>

if there is no data then i will receive second format .

<NAME/>

CTL FIle :

 LOAD DATA infile 'XML_out.xml' "str '</ROWSET>'" 
APPEND INTO TABLE SHM.REF_NAME TRAILING NULLCOLS 
( 
dummy filler char(1000) terminated by "<ROWSET>", 
NAME char(1000) enclosed by "<NAME>" and "</NAME>" 
)

However i am getting error:

Initial enclosure character not found which is for second format.

James Z
  • 12,209
  • 10
  • 24
  • 44
sharan jain
  • 85
  • 1
  • 11
  • I'll 2nd that question. I'd like to know if it is possible to accommodate for empty nodes in ```sqlldr```. I imagine there is some NULL condition that can be used, but I have not found any documentation around this. – alexherm Nov 20 '19 at 16:50

2 Answers2

0

I dont think its possible in SQLLDR directly. Take a look at this thread.

Can Oracle SQL*Loader process XML?

alexherm
  • 1,362
  • 2
  • 18
  • 31
0

As i workaround by XSTL write output as html

 <xsl:output method="html" version="4.0" encoding="UTF-8" indent="yes"/>

Code : https://xsltfiddle.liberty-development.net/ejivdHg/2

sharan jain
  • 85
  • 1
  • 11