How to insert more than 32k xml data into oracle clob column

how to insert more than 32k xml data into oracle clob column.
xml data is coming from java front end
if we cannot use clob than what are the different options available

Are you facing any issue with my code?
String lateral size error will come when you try to insert the full xml in string format.
public static boolean writeCLOBData(String tableName, String id, String columnName, String strContents) throws DataAccessException{
  boolean isUpdated = true;
  Connection connection = null;
  try {
  connection = ConnectionManager.getConnection ();
  //connection.setAutoCommit ( false );
  PreparedStatement PREPARE_STATEMENT = null;
  String sqlQuery = "UPDATE " + tableName + " SET " + columnName + "  = ?  WHERE ID =" + id;
  PREPARE_STATEMENT = connection.prepareStatement ( sqlQuery );
  // converting string to reader stream
  Reader reader = new StringReader ( strContents );
  PREPARE_STATEMENT.setClob ( 1, reader );
  // return false after updating the clob data to DB
  isUpdated = PREPARE_STATEMENT.execute ();
  PREPARE_STATEMENT.close ();
  } catch ( SQLException e ) {
  e.printStackTrace ();
  finally{
  return isUpdated;
Try this JAVA code.

Similar Messages

  • How to insert more than one row in an Oracle table in one go

    Hi All,
    I am working on a file-XI(BPM)-Oracle scenario.
    I am sending an xml file to XI via a file adapter. On the receiver end i am using a jdbc adapter to insert the row in the database. There is a transformation step within the BPM which is converting the file to a format understood by the JDBC adapter.
    The problem i am facing is that, even if my input xml file contains more than one recordset, only one row is created in the database with the first recordset.
    How can i insert all the other recordsets in the database at the same time.
    Pls guide
    Thanks in advance.
    Regards
    Neetu

    Hi,
    As asked by Bhavesh, i set the occurence of the STATEMENT tab 1 to UB. But still only one row is getting updated in the database at a time.
    As asked by Udo, i even tried the same by changing the occrence of ACCESS tab 1 to UB. But still same thing happened.
    Can there be some other problem.
    The transformation is being dane in the BPM.
    As seen in SXMB_MONI, the input xml to the BPM has two RECORDSET tags but the output generated xml in the format understood by jdbc adapter has a single STATEMENT tag.
    The two formats are given below
    <b>Input:</b>     
            <?xml version="1.0" encoding="utf-8"?>
         <ns:MT_Test_File xmlns:ns="http://namespace-EmpNumberGen">
         <EmpGenRecord>
              <APPLICANT_NO>20</APPLICANT_NO>
              <FIRST_NAME>abc</FIRST_NAME>
              <LAST_NAME>xyz</LAST_NAME>
              <FUNCTION>ADMIN</FUNCTION>
              <DESIGNATION>ZA</DESIGNATION>
              <RESPONSIBILITY_LEVEL>dd</RESPONSIBILITY_LEVEL>
              <RECRUITMENT_TYPE>dd</RECRUITMENT_TYPE>
              <EMPLOYEE_TYPE>p</EMPLOYEE_TYPE>
              <STATUS>A</STATUS>
              <***>M</***>
         </EmpGenRecord>
         <EmpGenRecord>
              <APPLICANT_NO>14</APPLICANT_NO>
              <FIRST_NAME>abc</FIRST_NAME>
              <LAST_NAME>xyz</LAST_NAME>
              <FUNCTION>ADMIN</FUNCTION>
              <DESIGNATION>ZA</DESIGNATION>
              <RESPONSIBILITY_LEVEL>dd</RESPONSIBILITY_LEVEL>
              <RECRUITMENT_TYPE>dd</RECRUITMENT_TYPE>
              <EMPLOYEE_TYPE>p</EMPLOYEE_TYPE>
              <STATUS>A</STATUS>
              <***>M</***>
         </EmpGenRecord>
    </ns:MT_Test_File>
    <b>Output</b>
            <?xml version="1.0" encoding="UTF-8"?>
         <ns0:MT_Emp_No_Generation xmlns:ns0="http://namespace-EmpNumberGen">
         <Statement>
              <SAP_EMPGEN action="INSERT">
                   <access>
                   <APPLICANT_NO>20</APPLICANT_NO>
                   <FIRST_NAME>abc</FIRST_NAME>
                   <LAST_NAME>xyz</LAST_NAME>
                   <FUNCTION>ADMIN</FUNCTION>
                   <DESIGNATION>ZA</DESIGNATION>
                   <RESPONSIBILITY_LEVEL>dd</RESPONSIBILITY_LEVEL>
                   <RECRUITMENT_TYPE>dd</RECRUITMENT_TYPE>
                   <EMPLOYEE_TYPE>p</EMPLOYEE_TYPE>
                   <STATUS>A</STATUS>
                   <***>M</***>
                   </access>
              </SAP_EMPGEN>
         </Statement>
         </ns0:MT_Emp_No_Generation>
    This is a bit urgent.
    Pls help
    Regards
    Neetu

  • Loading data into a CLOB column

    I need to find out how to load about ten sentences of data into a clob column for a table in the database. I have a pl/sql procedure that loads data from an xml file into various tables in the the database. Recently, we added a column (test_dummy) to one of the tables and defined it as a CLOB. There is a corresponding node (detail_info) in the XML file that maps to this column. I need to figure out how to incorporate this in the pl/sql procedure so that the data in the XML file for the node (detail_info) is loaded into "test_dummy". Any ideas?

    Take it one at a time. Use 'extract' function to extract an XML snippet from a given XML. The question couldn't be more vague. Maybe an example would help?
    Rahul

  • How to get more than 256 bytes data

    hello.
    I use Schlumberger 32K Card�iJava Card 2.1�j.
    Please tell me how to get more than 256 bytes data from the applet in the card!!
    According to JCRE specification, need to use Get Response Command.
    What is Get Response command?
    Do I have to write processing of Get Response command to an applet?
    Or JCRE processes Get Response command?
    If knows, please tell me about!!
    Thanks.

    Thanks for your response!!
    I understand that I have to write processing of Get Response command to an applet.
    But case of Schlumberger 32K card, when host send Get Response command to an applet, card reply 6F-00!?
    I'm investigating now, and it seems that response is returned before applet processes Get Response command(CLA = 00, INS = C0).
    Do JCRE perform the process of Get Response command?

  • How to insert more than 12 items using BDC for MB1C

    Hi,
    When we use LSMW for data transfer of MB1C transaction, more than 12 items can be  inserted in a document.
    But using BDC only 12 and below is possible, if the flat file system has more that 12 item, then the document is not created.
    How to insert more than 12 item in a document.
    Regards

    Hi Gow,
    I have uploaded the MB1C through a BDC and it is working fine for n no of items.
    Here is the code. May be this will be of your help.
    *& Report  ZMB1C
    report ZMB1C
           no standard page heading line-size 255.
    type-pools : slis.
    tables : t100.
    data: begin of record,
            MATNR(018),
            ERFMG(017),
            EXBWR(016),
          end of record.
    data : itab like table of record with header line.
    data : w_bdcdata type bdcdata.
    data : t_bdcdata type standard table of bdcdata initial size 1.
    data : messtab type standard table of bdcmsgcoll with header line.
    data : mstring(300).
    data : vf_index type i,
           no_lines type i,
           count type i value 0.
    data : v_bldat(20),
           v_budat(20).
    *Excel Sheet Data Upload Details
    data : vf_start_col type i value '1',      "start column
           vf_start_row type i value '2',      "start row
           vf_end_col   type i value '100',    "maximum column
           vf_end_row   type i value '10000'.  "maximum row
    */ Internal Table For Excel Data
    data : it_excel type  kcde_cells occurs 0 with header line.
    */ Field symbol
    field-symbols : <fs>.
    data : begin of it_messtab occurs 0,
           plant(10) type c,
           status(10) type c,
           message(90) type c,
           end of it_messtab.
    *Data for ALV display
    data : wa_fcat type slis_fieldcat_alv,
           colcnt type i.
    data : it_fieldcat type slis_t_fieldcat_alv,
           i_events type slis_t_event.
    data : l_title type sychar70.
    data : l_repid like sy-repid.
    * Selction Screen
    selection-screen begin of block b1 with frame title text-000.
    parameters : p_file like ibipparms-path obligatory,
                 p_mode like ctu_params-dismode default 'A'.
    selection-screen end of block b1.
    selection-screen begin of block b2 with frame title text-001.
    parameters : p_bldat like MKPF-BLDAT obligatory,
                 p_budat like MKPF-BUDAT obligatory,
                 p_bwart like RM07M-BWARTWA obligatory,
                 p_werks like RM07M-WERKS obligatory,
                 p_lgort like RM07M-LGORT obligatory.
    selection-screen end of block b2.
    * At Selction Screen
    at selection-screen on value-request for p_file.
      call function 'F4_FILENAME'
        EXPORTING
          program_name  = syst-cprog
          dynpro_number = syst-dynnr
          field_name    = ''
        IMPORTING
          file_name     = p_file.
    *Start of Selection Event
    start-of-selection.
      call function 'KCD_EXCEL_OLE_TO_INT_CONVERT'
        EXPORTING
          filename                = p_file
          i_begin_col             = vf_start_col
          i_begin_row             = vf_start_row
          i_end_col               = vf_end_col
          i_end_row               = vf_end_row
        TABLES
          intern                  = it_excel
        EXCEPTIONS
          inconsistent_parameters = 1
          upload_ole              = 2
          others                  = 3.
      if sy-subrc <> 0.
    * MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    *         WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
      if it_excel[] is initial.
        MESSAGE I000(ZCL_TCSABAP).
      else.
        sort it_excel by row col.
        loop at it_excel.
          move : it_excel-col to vf_index.
          assign component vf_index of structure itab to <fs>.
          move : it_excel-value to <fs>.
          at end of row.
            append itab.
            clear itab.
          endat.
        endloop.
      endif.
      if not itab[] is initial.
        DESCRIBE TABLE itab LINES no_lines.
        clear messtab.
        refresh messtab.
        CONCATENATE p_bldat+6(2) '.' p_bldat+4(2) '.' p_bldat(4) into v_bldat.
        CONCATENATE p_budat+6(2) '.' p_budat+4(2) '.' p_budat(4) into v_budat.
        perform map_rec.
        call transaction 'MB1C' using t_bdcdata mode p_mode update 'A'
        messages into messtab .
        clear t_bdcdata.
        refresh t_bdcdata.
        loop at messtab where msgtyp = 'E' or msgtyp = 'S' .
          select single * from t100 where sprsl = messtab-msgspra
                                    and   arbgb = messtab-msgid
                                    and   msgnr = messtab-msgnr.
          if sy-subrc = 0.
            mstring = t100-text.
            if mstring cs '&1'.
              replace '&1' with messtab-msgv1 into mstring.
              replace '&2' with messtab-msgv2 into mstring.
              replace '&3' with messtab-msgv3 into mstring.
              replace '&4' with messtab-msgv4 into mstring.
            else.
              replace '&' with messtab-msgv1 into mstring.
              replace '&' with messtab-msgv2 into mstring.
              replace '&' with messtab-msgv3 into mstring.
              replace '&' with messtab-msgv4 into mstring.
            endif.
            condense mstring.
            it_messtab-message = mstring(300).
            it_messtab-plant = p_werks.
            if messtab-msgtyp = 'E'.
              it_messtab-status = 'Error'.
            else.
              it_messtab-status = 'Success'.
            endif.
            append it_messtab.
            clear it_messtab.
          endif.
        endloop. "messtab
        if not it_messtab[] is initial.
          perform buildcatalog.
          perform display.
        endif.
      endif.
    *&      Form  Map_Rec
    *       text
    form  map_rec.
      perform bdc_dynpro      using 'SAPMM07M' '0400'.
      perform bdc_field       using 'BDC_CURSOR'
                                    'RM07M-WVERS3'.
      perform bdc_field       using 'BDC_OKCODE'
                                    'NPE'.
      perform bdc_field       using 'MKPF-BLDAT'
                                    v_bldat.
      perform bdc_field       using 'MKPF-BUDAT'
                                    v_budat.
      perform bdc_field       using 'RM07M-BWARTWA'
                                    p_bwart.
      perform bdc_field       using 'RM07M-WERKS'
                                    p_werks.
      perform bdc_field       using 'RM07M-LGORT'
                                    p_lgort.
      perform bdc_field       using 'XFULL'
      perform bdc_field       using 'RM07M-XNAPR'
                                    'X'.
      perform bdc_field       using 'RM07M-WVERS2'
      perform bdc_field       using 'RM07M-WVERS3'
                                    'X'.
      loop at itab.
        count = count + 1.
        perform bdc_dynpro      using 'SAPMM07M' '0410'.
        perform bdc_field       using 'BDC_CURSOR'
                                      'MSEG-EXBWR'.
        if count <> no_lines.
          perform bdc_field       using 'BDC_OKCODE'
                                        '=NPE'.
        elseif count = no_lines.
          perform bdc_field       using 'BDC_OKCODE'
                                        '=BU'.
        endif.
        perform bdc_field       using 'MSEG-MATNR'
                                      itab-MATNR.
        perform bdc_field       using 'MSEG-ERFMG'
                                      itab-ERFMG.
        perform bdc_field       using 'MSEG-EXBWR'
                                      itab-EXBWR.
      endloop. "itab
    endform. "Map_Rec
    **      Form  BDC_DYNPRO
    form bdc_dynpro using program dynpro.
      clear w_bdcdata.
      w_bdcdata-program  = program.
      w_bdcdata-dynpro   = dynpro.
      w_bdcdata-dynbegin = 'X'.
      append w_bdcdata to t_bdcdata.
    endform.                    "bdc_dynpro
    **      Form  BDC_FIELD
    form bdc_field using fnam fval.
      if fval <> space.
        clear w_bdcdata.
        w_bdcdata-fnam = fnam.
        w_bdcdata-fval = fval.
        append w_bdcdata to t_bdcdata.
      else.
        clear w_bdcdata.
        w_bdcdata-fnam = fnam.
        w_bdcdata-fval = fval.
        append w_bdcdata to t_bdcdata.
      endif.
    endform.                    "bdc_field
    *       FORM buildcatalog                                             *
    form buildcatalog.
      clear wa_fcat.
      clear it_fieldcat.
      colcnt = colcnt + 1.
      wa_fcat-col_pos      = colcnt.
      wa_fcat-fieldname    = 'PLANT'.
      wa_fcat-tabname      = it_messtab.
      wa_fcat-seltext_l    = 'PLANT'.
      wa_fcat-key          = 'X'.
      wa_fcat-outputlen  = '10'.
      append wa_fcat to it_fieldcat.
      clear wa_fcat.
      colcnt = colcnt + 1.
      wa_fcat-col_pos      = colcnt.
      wa_fcat-fieldname    = 'STATUS'.
      wa_fcat-tabname      = it_messtab.
      wa_fcat-seltext_l    = 'STATUS'.
      wa_fcat-outputlen  = '10'.
      append wa_fcat to it_fieldcat.
      clear wa_fcat.
      colcnt = colcnt + 1.
      wa_fcat-col_pos      = colcnt.
      wa_fcat-fieldname    = 'MESSAGE'.
      wa_fcat-tabname      = it_messtab.
      wa_fcat-seltext_l    = 'Message'.
      wa_fcat-outputlen  = '90'.
      append wa_fcat to it_fieldcat.
    endform.                    "buildcatalog
    *       FORM display                                                  *
    form display.
      l_title = text-002.
      l_repid = sy-repid.
      call function 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program = l_repid
          i_grid_title       = l_title
          it_fieldcat        = it_fieldcat
          it_events          = i_events[]
        TABLES
          t_outtab           = it_messtab
        EXCEPTIONS
          program_error      = 1
          others             = 2.
      if sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    endform.                    "display
    Regards,
    Amit

  • Steps to insert xml data into oracle

    Please give me next steps to insert xml data into oracle 9i:
    i've been doing this steps :
    1. create folder in oracle port:8080
    2. copy xsd into folder
    3. register schema
    4. Give me next step...
    5.
    6.
    Thanks

    this is my complete xmlschema
    <?xml version = "1.0" encoding = "UTF-8"?>
    <xs:schema xmlns:xs = "http://www.w3.org/2001/XMLSchema">
         <xs:element name = "A3A8Vers" type = "xs:string"/>
         <xs:element name = "F1F5Vers" type = "xs:string">
         </xs:element>
         <xs:element name = "sequence" type = "xs:string">
         </xs:element>
         <xs:element name = "amf" type = "xs:string">
         </xs:element>
         <xs:element name = "trnsKeyNumber" type = "xs:string">
         </xs:element>
         <xs:element name = "mac" type = "xs:string">
         </xs:element>
         <xs:element name = "encryptionKey" type = "xs:string">
         </xs:element>
         <xs:element name = "signature" type = "xs:string">
         </xs:element>
         <xs:element name = "signer">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element ref = "entityNumber"/>
                        <xs:element ref = "keyNumber"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name = "entityNumber" type = "xs:string">
         </xs:element>
         <xs:element name = "keyNumber" type = "xs:string">
         </xs:element>
         <xs:element name = "pblKey">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element ref = "entityNumber"/>
                        <xs:element ref = "entityRole"/>
                        <xs:element ref = "keyNumber"/>
                        <xs:element ref = "publicKeyVal"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name = "ntrTime" type = "xs:string">
         </xs:element>
         <xs:element name = "deActionTime" type = "xs:string">
         </xs:element>
         <xs:element name = "actionTime" type = "xs:string">
         </xs:element>
         <xs:element name = "entityRole">
              <xs:complexType>
                   <xs:attribute name = "role" default = "INVALID">
                        <xs:simpleType>
                             <xs:restriction base = "xs:NMTOKEN">
                                  <xs:enumeration value = "TKD"/>
                                  <xs:enumeration value = "SKD"/>
                                  <xs:enumeration value = "INVALID"/>
                             </xs:restriction>
                        </xs:simpleType>
                   </xs:attribute>
              </xs:complexType>
         </xs:element>
         <xs:element name = "publicKeyVal">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element ref = "exponent"/>
                        <xs:element ref = "mod"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name = "exponent" type = "xs:string">
         </xs:element>
         <xs:element name = "mod" type = "xs:string">
         </xs:element>
         <xs:element name = "encriptionTransKey" type = "xs:string">
         </xs:element>
         <xs:element name = "keyType" type = "xs:string">
         </xs:element>
    </xs:schema>.
    I use command to create table :
    create table elements of xmltype
    xmlschema "http://192.168.1.1:8080/test.xsd"
    element "publicKey"
    . But why the result,table as object type. so i cant use command "desc <table_name>;"

  • Reg: how to join more than one cluster table into one

    Hi gurus
    How to join more than one cluster table into one
    amk

    Hi,
    You cannot join cluster tables
    Best way is to select from the header table and then select from the item table table using for all entries of header table.
    regards,
    Advait

  • How to store XML data into Oracle Table

    I had trouble to store XML data into Oracle Table with XDK (Oracle 8.1.7 ). The error is:
    C:\XDK_Java_9_2\xdk\demo\java\Test>java testInsert Dept.xml
    <Line 1, Column 1>: XML-0108: (Fatal Error) Start of root element expected.
    Exception in thread "main" oracle.xml.sql.OracleXMLSQLException: Start of root element expected.
    at oracle.xml.sql.dml.OracleXMLSave.saveXML(OracleXMLSave.java:2263)
    at oracle.xml.sql.dml.OracleXMLSave.insertXML(OracleXMLSave.java:1333)
    at testInsert.main(testInsert.java:8)
    Here is my xml file:
    <?xml version = '1.0'?>
    <ROWSET>
    <ROW num="1">
    <DEPTNO>10</DEPTNO>
    <DNAME>ACCOUNTING</DNAME>
    <LOC>NEW YORK</LOC>
    </ROW>
    <ROW num="2">
    <DEPTNO>20</DEPTNO>
    <DNAME>RESEARCH</DNAME>
    <LOC>DALLAS</LOC>
    </ROW>
    <ROW num="3">
    <DEPTNO>30</DEPTNO>
    <DNAME>SALES</DNAME>
    <LOC>CHICAGO</LOC>
    </ROW>
    <ROW num="4">
    <DEPTNO>40</DEPTNO>
    <DNAME>OPERATIONS</DNAME>
    <LOC>BOSTON</LOC>
    </ROW>
    </ROWSET>
    and here is structure of table:
    Name Null? Type
    DEPTNO NOT NULL NUMBER(2)
    DNAME VARCHAR2(14)
    LOC VARCHAR2(13)
    and here is my Java Code:
    import java.sql.*;
    import oracle.xml.sql.dml.OracleXMLSave;
    public class testInsert{
         public static void main(String[] args) throws SQLException{
              Connection conn = getConnection();
              OracleXMLSave sav = new OracleXMLSave(conn,"scott.tmp_dept");
              sav.insertXML(args[0]);
              sav.close();
              conn.close();
         private static Connection getConnection()throws SQLException{
              DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
              Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@amt-ebdev01:1521:mydept","scott","tiger");
              return conn;
    Could you help me ? Thanks !

    The problem is that you need to pass avalid URL , Document...
    Please try this code instead:
    import java.net.*;
    import java.sql.*;
    import java.io.*;
    import oracle.xml.sql.dml.OracleXMLSave;
    public class testInsert
    public static void main(String[] args) throws SQLException{
    Connection conn = getConnection();
    OracleXMLSave sav = new OracleXMLSave(conn,"scott.temp_dept");
    URL url = createURL(args[0]);
    sav.insertXML(url);
    sav.close();
    conn.close();
    private static Connection getConnection()throws SQLException{
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@dlsun1982:1521:jwxdk9i","scott","tiger");
    return conn;
    // Helper method to create a URL from a file name
    static URL createURL(String fileName)
    URL url = null;
    try
    url = new URL(fileName);
    catch (MalformedURLException ex)
    File f = new File(fileName);
    try
    String path = f.getAbsolutePath();
    // This is a bunch of weird code that is required to
    // make a valid URL on the Windows platform, due
    // to inconsistencies in what getAbsolutePath returns.
    String fs = System.getProperty("file.separator");
    if (fs.length() == 1)
    char sep = fs.charAt(0);
    if (sep != '/')
    path = path.replace(sep, '/');
    if (path.charAt(0) != '/')
    path = '/' + path;
    path = "file://" + path;
    url = new URL(path);
    catch (MalformedURLException e)
    System.out.println("Cannot create url for: " + fileName);
    System.exit(0);
    return url;

  • XML data into Oracle Tables. XML file on Application Server.Oracle Apps R12

    Hi All,
    My Database version : 11.2.0.2.0
    I have an XML file which needs to be loaded into the Database Tables. How ever i do not want to use the XMLTYPE as given below
    insert into test1 (
    SELECT PrcDate, PmtType, PmtStatus, PmtTypeCount, PmtTypeAmt
    FROM XMLTABLE(
    '/WFPaymentAck/RejectedDom1ACH'
    PASSING XMLTYPE( BFILENAME('ECX_UTL_LOG_DIR_OBJ','wf_test_xml.XML'), NLS_CHARSET_ID('UTF8') )
    COLUMNS
    PrcDate VARCHAR2(2000) PATH '@PrcDate' ,
    PmtType VARCHAR2(2000) PATH '@PmtType' ,
    PmtStatus VARCHAR2(100) PATH '@PmtStatus' ,
    PmtTypeCount VARCHAR2(100) PATH 'PmtTypeCount' ,
    PmtTypeAmt VARCHAR2(100) PATH 'PmtTypeAmt'
    Because this way the XML file needs to reside on the DB server.
    I am looking into other option of loading the XML file into a CLOB column of a table and reading it from that column.
    I did a couple of tests and feel that this way also the XML file has to reside on the Database Server itself. I am not sure if this is correct or if there is any problem with our TEST instance.
    ++Can anyone let me know if i need to have the XML file on the DB server instead of the Application server to load into a CLOB column of table ??++
    ++Or++
    ++Is there any other workaround for me to load XML into Oracle Tables, while having the XML file on Application Server.++
    Your immediate help is appreciated. I need to get past this ASAP.
    Thanks in Advance.
    VJ

    1) Are you asking me to create a folder on Database directory which points to a folder on the Apps server ?I suggest creating an Oracle directory object (a database object) pointing to a real location (folder) on Application server.
    we DONOT want a hand shake between the DB Server and the APPS server.I don't see where the problem is.
    I'm not familiar with Apps R12 but there's no doubt the two servers are already communicating, at least App server should be able to access the DB for the whole thing to run.
    As I said :
    One way or another, the data has to make its way to the database, there's no workaround to that.How do you imagine the data will end up in a database table if it doesn't come to the DB server?
    There's no magical method out there, both servers have to communicate at some point.
    About client-server approaches (client being here the App server), you can read about accessing the XML DB repository in the XML DB Developer's Guide : http://download.oracle.com/docs/cd/E11882_01/appdev.112/e23094/toc.htm
    Other option : SQL*Loader can load a CLOB, or an XMLType column too
    Edited by: odie_63 on 19 déc. 2011 20:22

  • Best method to load XML data into Oracle

    Hi,
    I have to load XML data into Oracle tables. I tried using different options and have run into a dead end in each of those. I do not have knowledge of java and hence have restricted myself to PL/SQL solutions. I tried the following options.
    1. Using DBMS_XMLSave package : Expects the ROWSET and ROW tags. Connot change format of the incoming XML file (Gives error oracle.xml.sql.OracleXMLSQLException: Start of root element expected).
    2. Using the XMLPARSER and XMLDOM PL/SQL APIs : Works fine for small files. Run into memory problems for large files (Gives error java.lang.OutOfMemoryError). Have tried increasing the JAVA_POOL_SIZE but does not work. I am not sure whether I am changing the correct parameter.
    I have read that the SAX API does not hog memory resources since it does not build the entire DOM tree structure. But the problem is that it does not have a PL/SQL implementation.
    Can anyone PLEASE guide me in the right direction, as to the best way to achieve this through PL/SQL ??? I have not designed the tables so am flexible on using purely relational or object-relational design. Although would prefer to keep a purely relational design. (Had tried used object-relational for 1. and purely relational for 2. above)
    The XML files are in the following format, (EXAMINEEs with single DEMOGRAPHIC and multiple TESTs)
    <?xml version="1.0"?>
    <Root_Element>
    <Examinee>
    <MACode>A</MACode>
    <TestingJID>TN</TestingJID>
    <ExamineeID>100001</ExamineeID>
    <CreateDate>20020221</CreateDate>
    <Demographic>
    <InfoDate>20020221</InfoDate>
    <FirstTime>1</FirstTime>
    <LastName>JANE</LastName>
    <FirstName>DOE</FirstName>
    <MiddleInitial>C</MiddleInitial>
    <LithoNumber>73</LithoNumber>
    <StreetAddress>SomeAddress</StreetAddress>
    <City>SomeCity</City>
    <StateCode>TN</StateCode>
    <ZipCode>37000</ZipCode>
    <PassStatus>1</PassStatus>
    </Demographic>
    <Test>
    <TestDate>20020221</TestDate>
    <TestNbr>1</TestNbr>
    <SrlNbr>13773784</SrlNbr>
    </Test>
    <Test>
    <TestDate>20020221</TestDate>
    <TestNbr>2</TestNbr>
    <SrlNbr>13773784</SrlNbr>
    </Test>
    </Examinee>
    </Root_Element>
    Thanks for the help.

    Please refer to the XSU(XML SQL Utility) or TransX Utility(for Multi-language Document) if you want to load data in XML format into database.
    Both of them require special XML formats, please first refer to the following docs:
    http://otn.oracle.com/docs/tech/xml/xdk_java/doc_library/Production9i/doc/java/xsu/xsu_userguide.html
    http://otn.oracle.com/docs/tech/xml/xdk_java/doc_library/Production9i/doc/java/transx/readme.html
    You can use XSLT to transform your document to the required format.
    If you document is large, you can use SAX method to insert data into database. But you need to write the code.
    The following sample may be useful:
    http://otn.oracle.com/tech/xml/xdk_sample/xdksample_040602i.html

  • How to insert a pdf or jpeg image into a blob column of a table

    How to insert a pdf or jpeg image into a blob column of a table

    Hi,
    Try This
    Loading an image into a BLOB column and displaying it via OAS
    The steps are as follows:
    Step 1.
    Create a table to store the blobs:
    create table blobs
    ( id varchar2(255),
    blob_col blob
    Step 2.
    Create a logical directory in the database to the physical file system:
    create or replace directory MY_FILES as 'c:\images';
    Step 3.
    Create a procedure to load the blobs from the file system using the logical
    directory. The gif "aria.gif" must exist in c:\images.
    create or replace procedure insert_img as
    f_lob bfile;
    b_lob blob;
    begin
    insert into blobs values ( 'MyGif', empty_blob() )
    return blob_col into b_lob;
    f_lob := bfilename( 'MY_FILES', 'aria.gif' );
    dbms_lob.fileopen(f_lob, dbms_lob.file_readonly);
    dbms_lob.loadfromfile( b_lob, f_lob, dbms_lob.getlength(f_lob) );
    dbms_lob.fileclose(f_lob);
    commit;
    end;
    Step 4.
    Create a procedure that is called via Oracle Application Server to display the
    image.
    create or replace procedure get_img as
    vblob blob;
    buffer raw(32000);
    buffer_size integer := 32000;
    offset integer := 1;
    length number;
    begin
    owa_util.mime_header('image/gif');
    select blob_col into vblob from blobs where id = 'MyGif';
    length := dbms_lob.getlength(vblob);
    while offset < length loop
    dbms_lob.read(vblob, buffer_size, offset, buffer);
    htp.prn(utl_raw.cast_to_varchar2(buffer));
    offset := offset + buffer_size;
    end loop;
    exception
    when others then
    htp.p(sqlerrm);
    end;
    Step 5.
    Use the PL/SQL cartridge to call the get_img procedure
    OR
    Create that procedure as a function and invoke it within your PL/SQL code to
    place the images appropriately on your HTML page via the PL/SQL toolkit.
    from a html form
    1. Create an HTML form where the image field will be <input type="file">. You also
    need the file MIME type .
    2. Create a procedure receiving the form parameters. The file field will be a Varchar2
    parameter, because you receive the image path not the image itself.
    3. Insert the image file into table using "Create directory NAME as IMAGE_PATH" and
    then use "Insert into TABLE (consecutive, BLOB_OBJECT, MIME_OBJECT) values (sequence.nextval,
    EMPTY_BLOB(), 'GIF' or 'JPEG') returning BLOB_OBJECT, consecutive into variable_blob,
    variable_consecutive.
    4. Load the file into table using:
    dbms_lob.loadfromfile(variable_blob, variable_file_name, dbms_lob.getlength(variable_file_name));
    dbms_lob.fileclose(variable_file_name);
    commit.
    Regards,
    Simma........

  • Parsing xml data into oracle database

    Oracle ACEs,
    We got a requirement that needs to load xml data into oracle db. Is it possible to load xml data into oracle db using built-in package. Is Oracle provides one ?
    Our database version is Oracle 9i.
    Your help in this regard is highly appreciated.
    Many Thanks.

    Check this out.
    http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96612/d_xmlsav.htm#1008593

  • How to update more than one Bank data in LSMW using recording

    Hi friends,
    please let me know how can we upload more than one bank data for vendore master in LSMW, and i am Using Recording and i have to use that.
    thanks a lot.
    Regards,
    veeru.

    Hi
    I have used the direct input but, there are address fields missing in the direct input like, SORT2, MOB_NUMBER, SMTP_ADDR. these fields.
    when i see the documentation for direct input, it says for additional address you need to use another BAPI. but here the problem is we are using internal numbering for vendor, so how to link the created vendor and the address uploaded to correct vendor.
    thanks a lot,.

  • How to map more than one xml element with some Paragraph in a Text Frame

    Hi friends,
    I am new in InDesign Java Scripting and I have to place or map, more than one xml elements of different parents, into one textbox. Is it possible through JavaScript? Can anyone help me in this because I have no idea how it should work and it urgently required.
    Thanks in Advance

    I had answered to you already in your first post: the short answer is that it's not possible on the same text box unless you assign a common ancestor of these two "parents" item. That's not a question of scripting, it's the way Indesign handle the XML with the layout. Import a xml in Indesign and drop tags to page item. What you can do manually is quite representative of what can be done through scripting.
    If you assign this anscestor to the text frame, you have to expect that all text child items will be displayed in the text frame (including the text of all the child of the two "parents" and all the other parents/childs that could be under the common ancestor). Having a XML that is designed for Indesign usage is pretty much inevitable if you are doing anything "serious".

  • How to insert more than 4000 bytes in BLOB column

    Hi all,
    My oracle version is Oracle Database 11g Enterprise Edition Release 11.2.0.3.0.
    I have checked in google and in this forum also, but did not find the answer.
    When inserting into less than 4000 bytes, it is inserting without any issues. If i am inserting more than that, it is throwing
    error like this ORA-01460: unimplemented or unreasonable conversion requested.
    Can anybody guide me how to do this or link.
    Thanks in advance.
    Thanks,
    Pal

    user546710 wrote:
    Hi,
    Thank you very much for your reply.
    Before, I have not worked with BLOB column, so I don't know much about its using. Currently, I am using direct
    insert statement only. Its a normal stored procedure written in a package. I am calling this SP with other columns and
    with this BLOB column. I am able to insert into table, if the inserted file is less than 4000 bytes. If it is more than that,
    I am getting that problem.
    Thanks,
    VenuSQL variables can only hold 4000 bytes.
    PL/SQL can hold up to 32767
    I am getting that problem. 100% lacking in actionable detail
    post code & COMPLETE error message & code

Maybe you are looking for