How to read XML file in Stored Procedure in Oracle SQL? -
i need consume xml file folder , perform transformations on specific tag values (say eventname value "loadstopapp"), assign temp variable, , insert temp variable dummy table.
how can that, sample xml?
<?xml version="1.0" encoding="utf-8" standalone="yes" ?> <cisdocument> <eventname>loadstopappointment</eventname> <reasoncode>aph_</reasoncode> <reasoncodedescription>appointment changed</reasoncodedescription> <systemtimezoneoffset>0.000000</systemtimezoneoffset> <eventdatetime>2016-03-30t16:48:30</eventdatetime> <eventreporteddatetime>2016-03-30t16:48:30</eventreporteddatetime> <eventoccurreddatetime>2016-03-30t16:48:30</eventoccurreddatetime> </cisdocument>
insert dummy_table ( eventname, reasoncode, reasoncodedescription, systemtimezoneoffset, eventdatetime -- ,... ) select extractvalue( xml, '//cisdocument/eventname' ), extractvalue( xml, '//cisdocument/reasoncode' ), extractvalue( xml, '//cisdocument/reasoncodedescription' ), to_number( extractvalue( xml, '//cisdocument/systemtimezoneoffset' ) ), to_date( extractvalue( xml, '//cisdocument/systemtimezoneoffset' ), 'yyyy-mm-dd"t"hh24:mi:ss' ) -- ,... ( select xmltype( your_clob_value ) xml dual )
Comments
Post a Comment