• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

XML data loading in Oracle tables.  RSS feed

 
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have written a shell program that automatically loads xml data into oracle tables.
Here is the code:
cd /work/vsubra/edi/saxon
x=`ls *.xml`
echo $x
for file in ${x}
do
cat ${file} | sed 's$http://xml.cxml.org/schemas/cXML/1.2.007/cXML.dtd$/work/v
subra/edi/cXML007.dtd$g'>${file}.xml
mv ${file}.xml ${file}
echo ${file}
done
z=`ls *.xml`
for xmlfilename in ${z}
do
java com.icl.saxon.StyleSheet /work/vsubra/edi/saxon/${xmlfilename} /work/vsub
ra/edi/saxon/ariba.xsl>/work/vsubra/edi/saxon/${xmlfilename}.xml
a=$?
if [ "$a" -ne "0" ]
then
echo "Error(s) in transforming the file ${xmlfilename}"
mv -f ${xmlfilename} /work/vsubra/edi/error_files/${xmlfilename}
else
echo "Successful transformation of file ${xmlfilename}"
mv -f ${xmlfilename} /work/vsubra/edi/trans_files/${xmlfilename}
echo "Successful in moving the file ${xmlfilename}"
y=`ls *.xml`
for filename in ${y}
do
BKUP_FILE=${filename}`date +%m%d%y%H%M%S`.bkup
echo $BKUP_FILE
mv -f ${filename} /work/vsubra/edi/data/trial1.txt
echo "moved ${filename} to trial1.txt"
sqlldr userid="apps/apps" control="/work/vsubra/edi/control/xmlload.ctl"
b = $?
if [ "$b" -ne "0" ]
then
echo "Error(s), moving the ${filename} into the table omni_xmlfile"
else
echo "Completed moving the ${filename} into the table omni_xmlfile"
fi
mv -f /work/vsubra/edi/data/trial1.txt /work/vsubra/edi/backup/${BKUP_FILE}
c = $?
if [ "$c" -ne "0" ]
then
echo "Error(s), moving the ${filename} into the Backup"
exit
else
echo "Completed moving the ${filename} into the Backup"
fi
print "exec omni_loaddata" | sqlplus -s "apps/apps@nwpprd"
s = $?
if [ "$s" -ne "0" ]
then
echo "Error in loading into the temp table "
else
echo "Successful in loading into the temp table"
fi
done
fi
done
exit

But when I run it it gives me the folllowing error
ORA-29532: Java call terminated by uncaught Java exception:
oracle.xml.sql.OracleXMLSQLException: Start of root element expected.
ORA-06512: at "SYS.DBMS_XMLSAVE", line 91
ORA-06512: at "APPS.ARIBA_TEST_DATA", line 7
ORA-06512: at "APPS.OMNI_LOADDATA", line 16
ORA-06512: at line 1

Can someone explain what error this is and how can I correct it.
Thanks,
Vidhya
 
Curse your sudden but inevitable betrayal! And this tiny ad too!
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!