1 Reply Latest reply: Jul 25, 2013 2:26 PM by Jason_(A_Non) RSS

    Read XML from network

    936666

      How to read read the XML from n/w path.

      OS :Widows

      i am having a table in my database it consists of 10 columns.

      I need to read the XML from n/w path and insert into my table.

      I need to create stored procedure for this , what type of stored procedure needs to be created how to give the path as input to stored procedure.

      Any sample for this?

       

      Thanks!

        • 1. Re: Read XML from network
          Jason_(A_Non)

          Here's are two example for what you are looking for

           

          Re: Load xml data in Oracle table

          Re: insert .xml file into xmltype table?

           

          First you need to create a DIRECTORY object.  That is how Oracle works and it expects a DIRECTORY object instead of a physical path when performing operations that read/write from disk.  The directory path provided to the CREATE DIRECTORY command must be a directory that the machine Oracle DB resides on can see.

           

          Then you can go either of two routes.  You can INSERT that XML directly into a table, as shown in the second link I provided or you can read it into PL/SQL as the first link shows.  Then in either case, you can use SQL to parse the XML for you.

           

          Depending upon your needs, you may get better performance if you insert the XML into a table as the second link shows, assuming the XMLType column is stored as SECUREFILE BINARY XML.