How to insert large xml file to XMLType column?

Hi,
I have a table with one column as XMLType(Binary XML storage option and Free Text Indexing). When i try to insert a large XML as long as 8kb, i'm getting an error ORA-01704:string literal too long.
Insert into TEST values(XMLTYPE('xml HERE'));
How to insert large XML values to XMLType column?
Regards,
Sprightee

For a large XML file, you basically have two options - you can load the string directly as an XMLType, or you can load the string as a CLOB and cast it on the database side to an XMLType.
If you decide to load the XML as XmlType client-side, then you may be interested to know that versions of Oracle after 11.2.0.2 support the JDBC 4.0 SQLXML standard. See the JDBC driver release documentation here:
http://docs.oracle.com/cd/E18283_01/java.112/e16548/jdbcvers.htm#BABGHBCC
If you want to load as a CLOB, then you'll need to use PreparedStatement's setClob() method, or allocate an oracle.sql.clob object.
For versions before 11.2.0.2, you can create an XMLType with a constructor that includes an InputStream or byte[] array.
HTH
Edited by: 938186 on Jun 23, 2012 11:43 AM

Similar Messages

  • How to insert large xml file ino xmltype column

    Hi all,
    iam using oracle10g. I have a table example1(key_column varchar2(10),xml_column xmltype) like this. i want to insert xml file from server to xmltype column. Can you please anybody suggest regarding this.wht is the size of the xmltype column. is it same as clob like 2GB or sth different. and one more thing is iam creating one procedure in that procedure , in that we are fetching xmltype value into clob varable. is it correct or not...
    Thanks

    Manipulating a single XMLType of 2GB is probably not sensible period. I'm guessing that the content of a file that big is probably a set of smaller XML documents which someone has wrapped a begin and end tag around. Since databases are good at handling collections of documents (or collections of anything else for that matter), you should consider de-compising the large document back into a set of smaller documents before storing it in the database

  • Inserting large xml data into xmltype

    Hi all,
    In my project I need to insert very large XML data into xmltype column.
    My table:
    CREATE TABLE TransDetailstblCLOB ( id number, data_xml XMLType) XmlType data_xml STORE AS CLOB;
    I am using JDBC approach to insert values. It works fine for data less than 4000 bytes when using preparedStatement.setString(1, xmlData). As I have to insert large Xml data >4000 bytes I am now using preparedStatement.setClob() methods.
    My code works fine for table which has column declared as CLOB expicitly. But for TransDetailstblCLOB where the column is declared as XMLTYPE and storage option as CLOB I am getting the error : "ORA-01461: can bind a LONG value only for insert into a LONG column".
    This error means that there is a mismatch between my setClob() and column. which means am I not storing in CLOB column.
    I read in Oracle site that
    When you create an XMLType column without any XML schema specification, a hidden CLOB column is automatically created to store the XML data. The XMLType column itself becomes a virtual column over this hidden CLOB column. It is not possible to directly access the CLOB column; however, you can set the storage characteristics for the column using the XMLType storage clause."
    I dont understand its stated here that it is a hidden CLOB column then why not I use setClob()? It worked fine for pure CLOB column (another table) then Why is it giving such error for XMLTYPE table?
    I am struck up with this since 3 days. Can anyone help me please?
    My code snippet:
    query = "INSERT INTO po_xml_tab VALUES (?,XMLType(?)) ";
              //query = "INSERT INTO test VALUES (?,?) ";
         // Get the statement Object
         pstmt =(OraclePreparedStatement) conn.prepareStatement(query);
         // pstmt = conn.prepareStatement(query);
         //xmlData="test";
    //      If the temporary CLOB has not yet been created, create new
         temporaryClob = oracle.sql.CLOB.createTemporary(conn, true, CLOB.DURATION_SESSION);
         // Open the temporary CLOB in readwrite mode to enable writing
         temporaryClob.open(CLOB.MODE_READWRITE);
         log.debug("tempClob opened"+"size bef writing data"+"length "+temporaryClob.getLength()+
                   "buffer size "+temporaryClob.getBufferSize()+"chunk size "+temporaryClob.getChunkSize());
         OutputStream out = temporaryClob.getAsciiOutputStream();
         InputStream in = new StringBufferInputStream(xmlData);
    int length = -1;
    int wrote = 0;
    int chunkSize = temporaryClob.getChunkSize();
    chunkSize=xmlData.length();
    byte[] buf = new byte[chunkSize];
    while ((length = in.read(buf)) != -1) {
    out.write(buf, 0, length);
    wrote += length;
    temporaryClob.setBytes(buf);
    log.debug("Wrote lenght"+wrote);
         // Bind this CLOB with the prepared Statement
         pstmt.setInt(1,100);
         pstmt.setStringForClob(2, xmlData);
         int i =pstmt.executeUpdate();
         if (i == 1) {
         log.debug("Record Successfully inserted!");
         }

    try this, in adodb works:
    declare poXML CLOB;
    BEGIN
    poXML := '<OIDS><OID>large text</OID></OIDS>';
    UPDATE a_po_xml_tab set podoc=XMLType(poXML) WHERE poid = 102;
    END;

  • How to insert folloiwng XML file in Oracle -

    Hello
    This is on Database 11g.
    I have a very large XML file with following elements. I am new to PL SQL XML programming. How can I make Oracle read the OS file location where the XML file is located, open the XML file and insert XML data residing in their tag elements and non-tag elements ?
    <BillOfMaterialItem revisionIdentifier="--" billOfMaterialItemIdentifier="645-173-1" billOfMaterialItemUniqueIdentifier="IVI123019387" itemQuantity="6" globalProductQuantityTypeCode="PerAssembly" globalProductQuantityTypeCodeOther="" notes="" description="3/8" WIDE" proprietarySequenceIdentifier="115510509">
    - <AdditionalAttributes groupLabel="BOM Information">
      <AdditionalAttribute name="Line Number" value="20" dataType="Float" />
      </AdditionalAttributes>
      </BillOfMaterialItem>
    {code}
    Thanks,                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    forum has many example
    look at Re: Load xml data in Oracle table
    steps:
    - create oracle directory
    - create table(s) for your data, may be with column xmltype
    - parse xml files from oracle directory and insert into table(s)
    for example
    SQL> select * from v$version where rownum=1;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
    SQL>
    SQL> select *
      2      from (xmltable('*'
      3                     passing (xmltype(bfilename('GET_XML','sample.xml'),nls_charset_id('AL32UTF8')))
      4                     columns billofmaterialitem_revisionid varchar2(10) path '/BillOfMaterialItem/@revisionIdentifier'
      5                            , billofmaterialitem_itemid varchar2(20) path '/BillOfMaterialItem/@billOfMaterialItemIdentifier'
      6                            , BillOfMaterialItem_ItUId varchar2(20) PATH '/BillOfMaterialItem/@billOfMaterialItemUniqueIdentifier'
      7                            , billofmaterialitem_itemq varchar2(20) path '/BillOfMaterialItem/@itemQuantity'
      8                            , billofmaterialitem_gqtcode varchar2(20) path '/BillOfMaterialItem/@globalProductQuantityTypeCode'
      9                            , BillOfMaterialItem_notes varchar2(20) PATH '/BillOfMaterialItem/@notes'
    10                            , BillOfMaterialItem_desc varchar2(20) PATH '/BillOfMaterialItem/@description'
    11                            , billofmaterialitem_prseqid varchar2(20) path '/BillOfMaterialItem/@proprietarySequenceIdentifier'
    12                            , additionalattributes_grlbl varchar2(20) path '/BillOfMaterialItem/AdditionalAttributes/@groupLabel'
    13                            , additionalattribute_name varchar2(20) path '/BillOfMaterialItem/AdditionalAttributes//AdditionalAttribute/@name'
    14                            , additionalattribute_value varchar2(20) path '/BillOfMaterialItem/AdditionalAttributes//AdditionalAttribute/@value'
    15                            , AdditionalAttribute_dataType varchar2(20) PATH '/BillOfMaterialItem/AdditionalAttributes//AdditionalAttribute/@dataType'
    16                    )
    17           ) x
    18  /
    BILLOFMATERIALITEM_REVISIONID BILLOFMATERIALITEM_ITEMID BILLOFMATERIALITEM_ITUID BILLOFMATERIALITEM_ITEMQ BILLOFMATERIALITEM_GQTCODE BILLOFMATERIALITEM_NOTES BILLOFMATERIALITEM_DESC BILLOFMATERIALITEM_PRSEQID ADDITIONALATTRIBUTES_GRLBL ADDITIONALATTRIBUTE_NAME ADDITIONALATTRIBUTE_VALUE ADDITIONALATTRIBUTE_DATATYPE
    --                            645-173-1                 IVI123019387             6                        PerAssembly                                         3/8                     115510509                  BOM Information            Line Number              20                        Float
    SQL>

  • How to delete an .xml file from xmltype table?

    Hi expert,
    I am in I am in Oracle Enterprise Manager 11g 11.2.0.1.0.
    SQL*Plus: Release 11.2.0.1.0 Production on Tue Feb 22 11:40:23 2011
    I have inserted 3 .xml files into an xmltype table: DOCUMENT
    SQL> SELECT OBJECT_VALUE FROM document;
    OBJECT_VALUE
    <?xml version="1.0" encoding="WINDOWS-1252"?>
    <?xml-stylesheet href="http://www.accessdata.fda.gov/spl/stylesheet/spl.xsl" type="text/xsl"?>
    <document xmlns="urn:hl7-org:v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLoc
    ation="urn:hl7-org:v3 http://localhost:8080/home/DEV/xsd/spl.xsd" classCode="DOC">
    <id root="5ca4e3cb-7298-4948-8cc2-58e71ad32694"/>
    <code code="51725-0" c
    <?xml version="1.0" encoding="WINDOWS-1252"?>
    <?xml-stylesheet href="http://www.accessdata.fda.gov/spl/stylesheet/spl.xsl" type="text/xsl"?>
    <document xmlns="urn:hl7-org:v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLoc
    ation="urn:hl7-org:v3 http://localhost:8080/home/DEV/xsd/spl.xsd" classCode="DOC">
    <id root="03d6a2cd-fdda-4fe1-865d-da0db9212f34"/>
    <code code="51725-0" c
    <?xml version="1.0" encoding="WINDOWS-1252"?>
    <?xml-stylesheet href="http://www.accessdata.fda.gov/spl/stylesheet/spl.xsl" type="text/xsl"?>
    <document xmlns="urn:hl7-org:v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLoc
    ation="urn:hl7-org:v3 http://localhost:8080/home/DEV/xsd/spl.xsd" classCode="DOC">
    <id root="09ff06d6-8b85-43dd-b5cc-e22d00f02bd0"/>
    <code code="51725-0" c
    I tried to delete one xml file which with id root="03d6a2cd-fdda-4fe1-865d-da0db9212f34'
    delete from DOCUMENT
    where xmlexists('$p/document/id[@root="03d6a2cd-fdda-4fe1-865d-da0db9212f34"]'PASSING OBJECT_VALUE AS "p");
    but failed.
    Is there any expert can help?
    Thanks a lot!
    Cow
    Edited by: Cow on Mar 11, 2011 7:02 PM

    Hi,
    Namespace issue.
    You have to declare it in the XQuery prolog :
    DELETE FROM document
    WHERE XMLExists( 'declare default element namespace "urn:hl7-org:v3"; (::)
                      $p/document/id[@root=$root_value]'
                     passing object_value as "p",
                             '03d6a2cd-fdda-4fe1-865d-da0db9212f34' as "root_value" )
    ;

  • How to parse large xml file

    I need to parse large xml file which contains following tag. The size of the file is upto 10MB-50MB or more.
    <departments>
    <department>
    <a_depart id="124">
    <b_depart id="Bss_253">
    <bss_depart id="253">
    <attributes>
    <name_one>abc</name_one>
    </attributes>
    </bss_depart id="253">
    </b_depart id="Bss_253">
    </a_depart id="124">
    </department>
    <department>
    <a_depart id="124">
    <b_depart id="Bss_254">
    <mss_depart id="253">
              <attributes>
              <name_one>abc</name_one>
              <name_two>xyz</name_one>
              </attributes>
         </mss_depart>
         </b_depart>
    </a_depart>
    </department>
    <department>
    <a_depart id="124">
    <b_depart id="Bss_254">
    <mss_depart id="255">
              <attributes>
              <name_one>abc</name_one>
              <name_two>xyz</name_one>
              </attributes>
         </mss_depart>
         </b_depart>
    </a_depart>
    </department>
    <department>
    <a_depart id="125">
    <b_depart id="Bss_254">
    <mss_depart id="253">
              <attributes>
              <name_one>abc</name_one>
              <name_two>xyz</name_one>
              </attributes>
         </mss_depart>
         </b_depart>
    </a_depart>
    </department>
    I want to get the infomation for that xml file. like mss_depart id=233, building xpath dyanmically for every id and loading
    that using dom4j. which is very very slow.
    Is there any other solution for that to read the data using sax parser only.
    I want to execute the xpath or data for the following way.
    //a_depart/@id ------> all the ids of a_depart tags if it returns 3 values say 123,124,125
    after that i want to execute
    //a_depart[@id='123']/b_depart/@id like this ...to retrive the values of all the levels ...
         I am executing following xpath for every unique ids at all levels.
         List l = doc.selectNodes(xPathForID);
         List l1 = doc.selectNodes(xPathForAttributes+attributes.get(j)+"/text()");
    But it is very slow and taking lot of time.
    Is there any other way to solve this problem. If any please mail me it is urgent.
    I am using jdk1.4 and jdk1.5
    Is there any support for sax parser to execute xpath in jdk1.5 direclty, with out using dom4j
    Thanks in advance....

    I doubt you will find a preexisting solution to your problem.
    SAX is usually recommended for processing big files (where "big" is undefined"). It works on big files by avoiding the messy problem of storing the data -- that is left as an exercise to you.
    DOM (and its variants) works by building a Document object as the head of the tree of objects for the entire contents. With DOM, you can then use XPath, because there is something to search that is already in memory. To use XPath, you seem to have two choices, build a DOM-ish tree, or if you can find an XPath processor (I'm not sure if one exists) that can process the XML file directly, but it will be slow, since you are looking for "all" occurences of an attribute, and this means you have to read the entire file each time.
    It might be worth exploring a hybrid approach -- use SAX to get some information, and build your own objects to store the data. Maybe a HashMap as the main index. But, that will keep you from using XPath, since you do not have the data structures it expects.
    A third alternative would be to look at JAXB. It builds Java code from a Schema of your data and then when you import the data, it creates the necessary objects and fills in values. But, I don't think XPath woll work there either.
    Dave Patterson

  • How to insert External XML file content into XMLTYPE through Pro*c

    Could any one sugest me how to insert a external XML file content into Db
    into XMLTYPE datatype through Pro*c program.
    Thanks for any help...... who has done this
    Ghanta Tagore

    Hi
    After some good fight of 3 days, I have done it through Pro*c
    This is the way to handle this
    Buffer-->Temporary Clob-->XMLTYPE(using CreateXml)
    Pasting my piece o code to do this
    ===============
    OCIClobLocator *license_txt;
    varchar h_ttt[1024] = {'\0'};
    ub4 amt;
    int i;
    EXEC SQL ALLOCATE :license_txt;
    EXEC SQL LOB CREATE TEMPORARY :license_txt ;
    GetName(name); /*Gets Name to insert into name column in License Table*/
    for(i=0; i<4;i++)
    GetXMLL((char *)h_ttt.arr); /*Gets a string value of XML into this example*/
    /*<Tagore>Is From TCS Delhi</Tagore>*/
    /*This can be changed to get buffer from FILE */
    h_ttt.len = strlen((char *)h_ttt.arr);
    amt = sizeof(char) * h_ttt.len ;
    EXEC SQL LOB WRITE APPEND :amt FROM :h_ttt INTO :license_txt;
    EXEC SQL
    INSERT INTO license_table VALUES (:sss, :name, sys.xmltype.createXML(:license_txt))
    ================
    Thanks For ur Help
    Tagore Ghanta

  • How to insert large xml data into database tables.

    Hi all,
    iam new to xml. i want to insert data in xml file to my database tables.but the xml file size is very large. performance is also one of the issue. can anybody please tell me the procedure to take xml file from the server and insert into my database tables.
    Thanks in advance

    Unfortunately posting very generic questions like this in the forum tends not to be very productive for you, me or the other people who read the forum. It really helps everyone if you take a little time to review existing posts and their answers before starting new threads which replicate subjects that have already been discussed extensively in previous threads. This allows you to ask more sensible questions (eg, I'm using this approach and encountering this problem) rather than extremely generic questions that you can answer yourself by spending a little time reviewing existings posts or using the forum's search feature.
    Also in future your might want to try being a little more specific before posting questions
    Eg Define "very large". I know of customers who thing very large is 100K, and customers who think 4G is medium. I cannot tell from your post what size your files are.
    What is the content of the file. Is it going to be loaded into a single record, or a a single table, or will it need to be loaded into multiple records in a single table or multiple records in multiple tables ?
    Do you really need to load the data into exsiting relational tables or could your application work with relational views of the XML Content.
    Finally which release of the database are you working with.
    Define performance. Is it reasonable to expect to process this kind of document on this machine (Make, memory, #number of CPUs, CPU Speed, number of discs) in this period of time.
    WRT to your original question. If you take a few minutes to search this forum you will find a very large number of threads with very similar titles to yours. These theads document a number of different approaches that can be used to solve this problem.
    I suggest you start by looking for threads that cover topics like DBMS_XMLSTORE, XMLTable(), Relational Views of XML content, loading XML content in relational tables.

  • Insert large XML files into 11g

    Can anyone post an example of inserting XML files into a XMLType table? I can use the following to insert files into a CLOB table without problems.
    $lob = oci_new_descriptor($conn, OCI_D_LOB);
              $sql = "insert into D (DATASET_ID, XML_DATA)
    values(
                   dataset_id_seq.NEXTVAL,
                   EMPTY_CLOB( )
              ) RETURNING XML_DATA into :the_blob";
              $stmt = oci_parse($conn, $sql);
              oci_bind_by_name($stmt, ':the_blob', $lob, -1, OCI_B_CLOB);
              oci_execute($stmt, OCI_DEFAULT);
              if ($lob->savefile($f)){
                   oci_commit($conn);
                   echo "Blob successfully uploaded\n";
              }else{
                   echo "Couldn't upload Blob\n";
              oci_free_descriptor($lob);
              oci_free_statement($stmt);

    A small example to insert xml file into oracle xml DB
    //$Xml contains the xml file you want to insert into the database.
    $insertXML = <<<EOF
    DECLARE xml CLOB := $Xml; begin INSERT INTO purchaseorder_as_column VALUES (1,XMLType(xml)); end;
    EOF;
    $stid = oci_parse($c, $insertXML);
    oci_execute($stid);
    //retrieve the xml data from the that table
    $sql = "select XMLTYPE.GetClobVal(xml_document) from purchaseorder_as_column where id=1";
    $stid = oci_parse($c, $sql);
    oci_execute($stid);
    $res = oci_fetch_row($stid);
    $xmldoc = $res[0]->load();
    //Then use simple xml extensions or others as you like to deal with the XML document
    $sxe = simplexml_load_string($xmldoc);
    //other operations with tthe xml data
    var_dump($sxe);

  • How to read a XML file from BLOB column and insert in a table - PL/SQL Only

    Hi,
    To make data load more simple to end user instead placing file on the server and use SQL-LOADER, I came up with new idea that using oracle ebusiness suite attachment functionality. that loads a XML file from local PC to a database column(table is fnd_attachments, default data type is BLOB over here).
    I tried with DBMS_LOB and didnt get around.
    Please can anyone tell me how to read the BLOB column using PL/SQL and store the data in a oracle table. Here's the sample XML file and table structure FYI.
    <?xml version="1.0" encoding="UTF-8"?>
    <dataroot xmlns:od="urn:schemas-microsoft-com:officedata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Corporate_alloc.xsd" generated="2009-07-07T14:17:49">
    <Corporate_alloc>
    <PKG_CODE>BKCORP</PKG_CODE>
    <PKG_NAME>Corporate Edition - Books</PKG_NAME>
    <DET_CODE>B9780080543758</DET_CODE>
    <DET_NAME>Waves, Tides and Shallow-Water Processes</DET_NAME>
    <ALLOCATION_RATIO>0.000041</ALLOCATION_RATIO>
    </Corporate_alloc>
    <Corporate_alloc>
    <PKG_CODE>BKCORP</PKG_CODE>
    <PKG_NAME>Corporate Edition - Books</PKG_NAME>
    <DET_CODE>B9780080534343</DET_CODE>
    <DET_NAME>Hydrostatically Loaded Structures</DET_NAME>
    <ALLOCATION_RATIO>0.000127</ALLOCATION_RATIO>
    </Corporate_alloc>
    </dataroot>
    CREATE TABLE TEST_XML
    ( PKG_CODE VARCHAR2(50),
    PKG_NAME VARCHAR2(100),
    DET_CODE VARCHAR2(20),
    DET_NAME VARCHAR2(500),
    ALLOCATION_RATIO NUMBER )
    Thanks
    EBV

    In regards to #3, use the COLUMNS functionality of XMLTable instead of using Extract. Two simple examples are
    Re: XML Data - Caliculate fields
    Re: Extractvalue function not recognised

  • Updating the whole xml file in  XMLType column

    Hi ,
    I am facing the problem in updating the XMLTYPE column.
    I need to update the whole xml file
    This is my table
    SQL> desc EMPJAL_TABLE;
    Name Null? Type
    EMPLOYEEID NOT NULL VARCHAR2(140)
    EMPCOM VARCHAR2(100)
    EMPJAL SYS.XMLTYPE(XMLSchema "www.EMPSIM.com" Element "EMPJAL") STORAGE
    Object-relational TYPE "EMPJAL_T"
    I am able to form the CLOB object and trying to use this sql command
    UPDATE EMPJAL_TABLE SET EMPJAL = XMLType( ? ) ) WHERE EMPLOYEEID ='emp1234';
    Here I want to update the whole xmlfile in XMLTYPE column.
    Error is - ORA-00933: SQL command not properly ended
    Please advise
    Thanks
    Govinds

    Hi Mark,
    I apologise for this mistake. I am really putting lot of efforts and also worked/working in advance topics of XML DB.
    Yes I am extensively using Oracle 10g r2 and suggesting others to use this
    This time I had put more effort before posting ,I had a series of queries to resolve most of then were working , this was the one giving problem inside my java code
    I am sorry for this .
    Any how I made another query which works better.
    Thanks
    Govinda

  • Illegal combination when importing xml file into xmltype column

    I have the following control file.
    LOAD DATA
    CHARACTERSET UTF8
    INFILE *
    INTO TABLE IMPORTRAWXML TRUNCATE
    SITEID constant 0
    ,VENDORID constant 17
    ,SITEFORMATID constant 2
    ,"\\plutonium\outcomes\AHA GWTG-Outpatient\Programs\DataTransfer\LoadTest\V17_standard_test.xml" filler char(1000)
    ,RAWDATA LOBFILE ("\\plutonium\outcomes\AHA GWTG-Outpatient\Programs\DataTransfer\LoadTest\V17_standard_test.xml")
    TERMINATED BY EOF
    )When I run it using sqlldr command line I get the following error:
    SQL*Loader-350: Syntax error at line 1.
    Illegal combination of non-alphanumeric characters
    <?xml version="1.0" encoding="ISO-8859-1"?>Does anyone have any idea what I am doing wrong here? If I remove the fully resolved path (both the control file and xml file are in the same folder) it tells me it can't find the file to load.
    HELP!!!!
    Thanks,
    Eva

    evaleah wrote:
    I have made sure all my home settings are correct in my registry editor and they are. Another thing to note is the control file I am using works 100% perfectly, beautifully when called from Toad for Oracle. It is when called from the command line utility that it fails. Is there anyway to determine what the difference could be?
    So we know that I can work (toad works), but it doesn't yet work in a "cmd" environment.
    Just as any other program Toad is also a client and uses NLS and other environment settings. Maybe these are stored in the registry, maybe the are being set by Toad by reading a configuration file while it is started or while running.
    As said, on Windows its tricky...
    Setting properties in the registry will not mean that they are the same a "cmd" window or maybe not even been set.
    If you execute / run "cmd" then the "set" statement/command will output the environment settings that will be used during the livetime of that "cmd" session.
    C:/> setIn my laptop environment (windows 7 64 bit) it will show the following
    C:\>set
    ALLUSERSPROFILE=C:\ProgramData
    APPDATA=C:\Users\marco\AppData\Roaming
    CommonProgramFiles=C:\Program Files\Common Files
    CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
    CommonProgramW6432=C:\Program Files\Common Files
    COMPUTERNAME=00-00-000
    ComSpec=C:\Windows\system32\cmd.exe
    DEFLOGDIR=C:\ProgramData\McAfee\DesktopProtection
    FP_NO_HOST_CHECK=NO
    HOMEDRIVE=C:
    HOMEPATH=\Users\marco
    LOCALAPPDATA=C:\Users\marco\AppData\Local
    LOGONSERVER=\\AMISNT
    MpConfig_ProductAppDataPath=C:\ProgramData\Microsoft\Windows Defender
    MpConfig_ProductCodeName=AntiSpyware
    MpConfig_ProductPath=C:\Program Files\Windows Defender
    MpConfig_ProductUserAppDataPath=C:\Users\marco\AppData\Local\Microsoft\Windows
    Defender
    MpConfig_ReportingGUID=CA08B82B-EF0A-4107-89D8-ED5BB37E7515
    NUMBER_OF_PROCESSORS=2
    OS=Windows_NT
    Path=C:\oracle\product\11.2.0\dbhome_1\bin;C:\Windows\system32;C:\Windows;C:\Win
    dows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\
    PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
    PERL5LIB=c:\oracle\product\10.2.0\db_1\perl\5.8.3\lib\MSWin32-x64;c:\oracle\prod
    uct\10.2.0\db_1\perl\5.8.3\lib;c:\oracle\product\10.2.0\db_1\perl\site\5.8.3;c:\
    oracle\product\10.2.0\db_1\perl\site\5.8.3\lib;c:\oracle\product\10.2.0\db_1\sys
    man\admin\scripts;
    PROCESSOR_ARCHITECTURE=AMD64
    PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 23 Stepping 10, GenuineIntel
    PROCESSOR_LEVEL=6
    PROCESSOR_REVISION=170a
    ProgramData=C:\ProgramData
    ProgramFiles=C:\Program Files
    ProgramFiles(x86)=C:\Program Files (x86)
    ProgramW6432=C:\Program Files
    PROMPT=$P$G
    PSModulePath=C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
    PUBLIC=C:\Users\Public
    SESSIONNAME=Console
    SystemDrive=C:
    SystemRoot=C:\Windows
    TEMP=C:\Users\marco\AppData\Local\Temp
    TMP=C:\Users\marco\AppData\Local\Temp
    USERDNSDOMAIN=AMIS
    USERDOMAIN=AMIS
    USERNAME=marco
    USERPROFILE=C:\Users\marco
    VBOX_INSTALL_PATH=C:\Program Files\Sun\VirtualBox\
    VSEDEFLOGDIR=C:\ProgramData\McAfee\DesktopProtection
    windir=C:\Windows
    C:\>The only thing that identifies that I have Oracle installed is set in the %PATH% variable and %PERL5LIB%. From the path setting you can also deduct that I have Oracle 11 and Oracle 10 software installed. So when I execute "sqlldr" what NLS settings will it use and which tnsnames.ora alias for example to connect to the database...?
    You can you do it and see what happens...
    C:\>sqlldr
    SQL*Loader: Release 11.2.0.1.0 - Production on Wed May 12 20:36:25 2010
    Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
    Usage: SQLLDR keyword=value [,keyword=value,...]
    Valid Keywords:
    ...So it will pick the first "sqlldr" in the %PATH% environment setting. But what about NLS...? As said to be absolute sure you will have to set it in your environment.
    C:/> set ORACLE_HOME="C:\oracle\product\10.2.0\db_1"
    C:\> set
    Path=C:\oracle\product\11.2.0\dbhome_1\bin;C:\Windows\system32;C:\Windows;C:\Win
    dows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\
    PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
    PERL5LIB=c:\oracle\product\10.2.0\db_1\perl\5.8.3\lib\MSWin32-x64;c:\oracle\prod
    uct\10.2.0\db_1\perl\5.8.3\lib;c:\oracle\product\10.2.0\db_1\perl\site\5.8.3;c:\
    oracle\product\10.2.0\db_1\perl\site\5.8.3\lib;c:\oracle\product\10.2.0\db_1\sys
    man\admin\scripts;
    ORACLE_HOME="C:\oracle\product\10.2.0\db_1"
    C:\> echo %ORACLE_HOME%
    "C:\oracle\product\10.2.0\db_1"Because if I enter "sqlldr" it will pick the executable from the 11.2 install, but the ORACLE_HOME is set to the wrong environment
    Executing sqlldr now will give me an error
    C:\>sqlldr
    Message 2100 not found; No message file for product=RDBMS, facility=ULMessage 21
    00 not found; No message file for product=RDBMS, facility=UL
    C:\>Another thing you can notice now is that from that output alone, you can't deduct the Oracle "sqlldr" version anymore. Setting the ORACLE_HOME environment to either 10.2 or 11.2 will cause "sqlldr" to execute normally (at least thats how it looks) BUT in the case of the oracle 10.2 setting it will use the wrong message files etc. At least not the correct software versions / files "sqlldr" is shipped with. So you can (and most of the time) will get strange errors.
    C:\> set ORACLE_HOME=C:\oracle\product\10.2.0\db_1
    C:\>sqlldr
    SQL*Loader: Release 11.2.0.1.0 - Production on Wed May 12 20:45:00 2010
    C:\>set ORACLE_HOME=C:\oracle\product\11.2.0\dbhome_1
    C:\>sqlldr
    SQL*Loader: Release 11.2.0.1.0 - Production on Wed May 12 20:49:50 2010
    Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
    Usage: SQLLDR keyword=value [,keyword=value,...]
    ...In the registry you can find a lot of those variables are set for ORACLE_HOME, ORACLE_BASE, SQLPATH, maybe TNS_ADMIN, ORACLE_SID, NLS_LANG. You can find the variables IN the registry on two places. The most common one is the SYSTEM wide environment settings under //HKEY_LOCAL_MACHINE/SOFTWARE/ORACLE and in my case for 11.2 under //HKEY_LOCAL_MACHINE/SOFTWARE/ORACLE/KEY_OraDb11g_Home1.
    You could overrule this for to be active on "my user session", my login session as account "marco" under //HKEY_CURRENT_USER/Software/Oracle, but no one using Windows is doing this.
    Besides the "cmd" and registry environment, there is a different place as well were you can set these parameters. In windows go to "start", click "control panel", click "system", click tab "Advanced" and then click on the button on the bottum with "Environment Variables". Here you can see the distinction between user and system wide variables as well. Here you can also set NLS_LANG, ORACLE_HOME etc. If I am not mistaken than these will be the default values used in a fresh "cmd" window session. But they can and will interfere with programs you start via clicking them. For example something a Java program like SQL Developer (and/or Toad). If those values are not overrulled by the program by for example using his own variables from a config file or else, those sessings from the "system" / control panel item will be used. If it is the wrong mix, you will encounter strange issues.
    Setting ORACLE_HOME and ORACLE_BASE will be used by a lot of derived other settings for example the default place SQL*Net drivers and tnsnames aliases etc will be checked. For example setting the ORACLE_HOME to
    C:\> set ORACLE_HOME=C:\oracle\product\10.2.0\db_1will result in that the tnsnames aliases from
    C:\> set ORACLE_HOME=C:\oracle\product\10.2.0\db_1\NETWORK\adminwill be used and NOT the ones maybe needed from
    C:\oracle\product\11.2.0\dbhome_1\NETWORK\adminYou can overrule this behavior by setting the TNS_ADMIN variable. By default, most explicit form for example on linux and Unix, the following rule will be used by Oracle
    1) .tnsnames.ora in the home directory of the user
    2) standard default: $ORACLE_HOME/network/admin
    3) behavior can be overruled via setting $TNS_ADMINThe fact that you are able via Toad to execute it correctly proves you that it can be done. But Toad uses in your session "SQL*Net" or JDBC or ODBC or ADO or ? via its own configuration environment settings that are being set on which values...?
    Both Oracle and Toad use the OSI model (http://en.wikipedia.org/wiki/OSI_model), both have to follow the same rules. There hasn't been changed that much over the years, character set conversions are done in the "two task common" layer of the data transport on either side (client/server) when data travels between a client and server. And don't forget a database can be also be a client when for instance database links are being used. One of the reasons to read old manuals because there the basics are still perfectly explained: http://download.oracle.com/docs/cd/A57673_01/DOC/net/doc/NWUS233/ch2.htm#twotask (Oracle 7.3.4 Networking Manual).
    This long long story is just to show you that you have more control if you set variables explicitly in a "cmd" window (and or in a linux/unix shell (as long as the session isn't "forked")) BUT you will have to be precise. Check the environment a set those environment variables that control / that are being used by "sqlldr" (and that are probably more then you realised, for example that SQL_PATH variable is the default directory where SQL*Plus is looking and saving its "SQL" and spool "LIS" files).
    HTH

  • How to unmarshal large XML file

    I have a large (170 MB) XML document. The size is due to a complex tree structure that is an array. It's taking approximately 45 minutes to unmarshal the document into the OTD. Not sure if there's a way to process this XML document in pieces (logical section)?? Suggestions are appreciated.

    I tried your suggestion, but get an error when I try to export the XSD node. It's expecting a TargetNamespace. Here is the beginning of the XSD that I imported:
    <?xml version="1.0" encoding="utf-8"?>
    <xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="MeterReadingDocument" nillable="true" type="MeterReadingDocument" />
    <xs:complexType name="MeterReadingDocument">
    <xs:complexContent mixed="false">
    <xs:extension base="XmlDocumentBase">
    <xs:sequence>
    <xs:element minOccurs="0" maxOccurs="1" name="Remarks" type="ArrayOfString" />
    <xs:element minOccurs="0" maxOccurs="1" name="Header" type="ExportHeader" />
    <xs:element minOccurs="0" maxOccurs="1" name="ImportExportParameters" type="ImportExportParameters" />
    <xs:element minOccurs="0" maxOccurs="1" name="Channels" type="ArrayOfChannel" />
    </xs:sequence>
    </xs:extension>
    </xs:complexContent>
    </xs:complexType>
    If I add a targetNamespace, then I get an exception when I attempt to unmarshal the file. I get the message:
    There was an error during unmarshal.
    Expect: '{http://www.w3.org/2001/XMLSchema}MeterReadingDocument', found: 'MeterReadingDocument'
    Not sure what to do.
    Thanks.

  • How to insert data into clob or xmltype column

    when i am inserting to clob or xml type column i am getting error like ERROR at line 2:
    ORA-01704: string literal too long
    INSERT INTO po_clob_tab
    values(100,'<TXLife>
         <UserAuthRequest>
              <UserLoginName>UserId</UserLoginName>
         </UserAuthRequest>
         <TXLifeRequest>
              <TransRefGUID>0099962A-BFF3-4761-4058-F683398D79F7</TransRefGUID>
              <TransType tc="186">OLI_TRANS_CHGPAR</TransType>
              <TransExeDate>2008-05-29</TransExeDate>
              <TransExeTime>12:01:01</TransExeTime>
              <InquiryLevel tc="3">OLI_INQUIRY_OBJRELOBJ</InquiryLevel>
              <InquiryView>
                   <InquiryViewCode>CU186A</InquiryViewCode>
              </InquiryView>
              <ChangeSubType>
                   <ChangeTC tc="32">Update / Add Client Object Information</ChangeTC>
                   <!--TranContentCode tc = 1 (Add)
                                                           tc = 2 (Update)
                                                           tc = 3 (Delete)
                   -->
                   <TranContentCode tc="1">Add</TranContentCode>
              </ChangeSubType>
              <OLifE>
                   <SourceInfo>
                        <SourceInfoName>Client Profile</SourceInfoName>
                   </SourceInfo>
                   <Activity id="Act1" PartyID="Party1">
                        <ActivityStatus tc="2">In Progress</ActivityStatus>
                        <UserCode>123456</UserCode>
                        <Opened>2010-08-17</Opened>
                        <ActivityCode>CP10001</ActivityCode>
                        <Attachment>
                             <Description>LastScreenName</Description>
                             <AttachmentData>CP Create</AttachmentData>
                             <AttachmentType tc="2">OLI_ATTACH_COMMENT </AttachmentType>
                             <AttachmentLocation tc="1">OLI_INLINE </AttachmentLocation>
                        </Attachment>
                        <OLifEExtension VendorCode="05" ExtensionCode="Activity">
                             <ActivityExtension>
                                  <SubActivityCode>CP20001</SubActivityCode>
                             </ActivityExtension>
                        </OLifEExtension>
                   </Activity>
                   <Grouping id="Grouping1">
                        <Household>
                             <EstIncome>90000</EstIncome>
                        </Household>
                   </Grouping>
                   <Holding id="Holding1">
                        <HoldingTypeCode tc="2">Policy</HoldingTypeCode>
                        <Purpose tc="35">Accumulation</Purpose>
                        <Policy>
                             <ProductType tc="1009800001">AXA Network Non-Proprietary Variable Life Product</ProductType>
                             <ProductCode>Plus9</ProductCode>
                             <PlanName>Accumulator Plus 9.0</PlanName>
                             <Annuity>
                                  <QualPlanType tc="45">Qualified</QualPlanType>
                             </Annuity>
                             <ApplicationInfo>
                                  <ApplicationJurisdiction tc="35">New Jersey</ApplicationJurisdiction>
                                  <OLifEExtension VendorCode="05" ExtensionCode="ApplicationInfo">
                                       <ApplicationInfoExtension>
                                            <FinancialPlanIInd tc="0">False</FinancialPlanIInd>
                                            <AgentVerifiesOwnersID tc="1">True</AgentVerifiesOwnersID>
                                       </ApplicationInfoExtension>
                                  </OLifEExtension>
                             </ApplicationInfo>
                             <FinancialActivity>
                                  <FinActivityType tc="7">Initial Payment</FinActivityType>
                                  <FinActivityPct>10</FinActivityPct>
                                  <Payment>
                                       <SourceOfFundsTC tc="18">Gift</SourceOfFundsTC>
                                       <OLifEExtension VendorCode="05" ExtensionCode="Payment">
                                            <PaymentExtension>
                                                 <FundingDisclosureDetails>
                                                      <FundingDisclosureTC tc="1009800001">Cash</FundingDisclosureTC>
                                                 </FundingDisclosureDetails>
                                            </PaymentExtension>
                                       </OLifEExtension>
                                  </Payment>
                             </FinancialActivity>
                             <FinancialActivity>
                                  <FinActivityType tc="7">Initial Payment</FinActivityType>
                                  <FinActivityPct>10</FinActivityPct>
                                  <Payment>
                                       <SourceOfFundsTC tc="8">Personal Loan</SourceOfFundsTC>
                                       <OLifEExtension VendorCode="05" ExtensionCode="Payment">
                                            <PaymentExtension>
                                                 <FundingDisclosureDetails>
                                                      <FundingDisclosureTC tc="1009800002">Borrowing</FundingDisclosureTC>
                                                 </FundingDisclosureDetails>
                                            </PaymentExtension>
                                       </OLifEExtension>
                                  </Payment>
                             </FinancialActivity>
                             <FinancialActivity>
                                  <FinActivityType tc="7">Initial Payment</FinActivityType>
                                  <FinActivityPct>10</FinActivityPct>
                                  <Payment>
                                       <SourceOfFundsTC tc="10">Withdrawal</SourceOfFundsTC>
                                       <OLifEExtension VendorCode="05" ExtensionCode="Payment">
                                            <PaymentExtension>
                                                 <FundingDisclosureDetails>
                                                      <FundingDisclosureTC tc="1009800003">Policy Related</FundingDisclosureTC>
                                                 </FundingDisclosureDetails>
                                            </PaymentExtension>
                                       </OLifEExtension>
                                  </Payment>
                             </FinancialActivity>
                             <FinancialActivity>
                                  <FinActivityType tc="7">Initial Payment</FinActivityType>
                                  <FinActivityPct>10</FinActivityPct>
                                  <Payment>
                                       <OLifEExtension VendorCode="05" ExtensionCode="Payment">
                                            <PaymentExtension>
                                                 <FundingDisclosureDetails>
                                                      <FundingDisclosureTC tc="1009800005">Sale of 401(k) Mutual Fund Shares, Existing Pension Plan Assets, Stocks, Bonds, CD’s</FundingDisclosureTC>
                                                 </FundingDisclosureDetails>
                                            </PaymentExtension>
                                       </OLifEExtension>
                                  </Payment>
                             </FinancialActivity>
                             <FinancialActivity>
                                  <FinActivityType tc="7">Initial Payment</FinActivityType>
                                  <FinActivityPct>10</FinActivityPct>
                                  <Payment>
                                       <OLifEExtension VendorCode="05" ExtensionCode="Payment">
                                            <PaymentExtension>
                                                 <FundingDisclosureDetails>
                                                      <FundingDisclosureTC tc="1009800004">Sale of qualified or non-qualified Mutual Fund Shares</FundingDisclosureTC>
                                                 </FundingDisclosureDetails>
                                            </PaymentExtension>
                                       </OLifEExtension>
                                  </Payment>
                             </FinancialActivity>
                             <FinancialActivity>
                                  <FinActivityType tc="7">Initial Payment</FinActivityType>
                                  <FinActivityPct>20</FinActivityPct>
                                  <Payment>
                                       <OLifEExtension VendorCode="05" ExtensionCode="Payment">
                                            <PaymentExtension>
                                                 <FundingDisclosureDetails>
                                                      <FundingDisclosureTC tc="1009800006">Sale of Investment Advisory Assets</FundingDisclosureTC>
                                                 </FundingDisclosureDetails>
                                            </PaymentExtension>
                                       </OLifEExtension>
                                  </Payment>
                             </FinancialActivity>
                             <FinancialActivity>
                                  <FinActivityType tc="7">Initial Payment</FinActivityType>
                                  <FinActivityPct>20</FinActivityPct>
                                  <Payment>
                                       <SourceOfFundsTC tc="1009800008">Car</SourceOfFundsTC>
                                       <OLifEExtension VendorCode="05" ExtensionCode="Payment">
                                            <PaymentExtension>
                                                 <FundingDisclosureDetails>
                                                      <FundingDisclosureTC tc="2147483647">Other</FundingDisclosureTC>
                                                 </FundingDisclosureDetails>
                                            </PaymentExtension>
                                       </OLifEExtension>
                                  </Payment>
                             </FinancialActivity>
                        </Policy>
                   </Holding>
                   <Party id="Party1">
                        <PartyTypeCode tc="1">Person</PartyTypeCode>
                        <EstNetWorth>250000</EstNetWorth>
                        <LiquidNetWorthAmt>120000</LiquidNetWorthAmt>
                        <EstTotAssetsAmt>400000</EstTotAssetsAmt>
                        <Person>
                             <FirstName>John</FirstName>
                             <LastName>Doe</LastName>
                             <MarStat tc="1">Married</MarStat>
                             <Gender tc="1">Male</Gender>
                             <BirthDate>1965-05-07</BirthDate>
                             <EducationType tc="3">Associate Degree</EducationType>
                             <Citizenship tc="1">USA</Citizenship>
                             <NetIncomeAmt>70000</NetIncomeAmt>
                             <DriversLicenseNum>D123456789</DriversLicenseNum>
                             <DriversLicenseState tc="35">New Jersey</DriversLicenseState>
                             <ImmigrationStatus tc="8">Citizen</ImmigrationStatus>
                             <DriversLicenseExpDate>2012-05-25</DriversLicenseExpDate>
                             <OLifEExtension VendorCode="05" ExtensionCode="Person">
                                  <PersonExtension>
                                       <NoDriversLicenseInd tc="0">False</NoDriversLicenseInd>
                                  </PersonExtension>
                             </OLifEExtension>
                        </Person>
                        <Address>
                             <Line1>125 Finn Lane</Line1>
                             <City>North Brunswick</City>
                             <AddressStateTC tc="35">New Jersey</AddressStateTC>
                             <Zip>08902</Zip>
                        </Address>
                        <Phone>
                             <PhoneTypeCode tc="1">Home</PhoneTypeCode>
                             <DialNumber>732456789</DialNumber>
                        </Phone>
                        <Phone>
                             <PhoneTypeCode tc="2">Work</PhoneTypeCode>
                             <DialNumber>732987654</DialNumber>
                        </Phone>
                        <Attachment>
                             <Description>Comments</Description>
                             <AttachmentData>This is the comments entered for the client</AttachmentData>
                             <AttachmentType tc="2">OLI_ATTACH_COMMENT </AttachmentType>
                             <AttachmentLocation tc="1">OLI_INLINE </AttachmentLocation>
                        </Attachment>
                        <Attachment>
                             <AttachmentSysKey>1</AttachmentSysKey>
                             <Description>Additional Notes Important Considerations</Description>
                             <AttachmentData>This is the comments entered for the client</AttachmentData>
                             <AttachmentType tc="2">OLI_ATTACH_COMMENT </AttachmentType>
                             <AttachmentLocation tc="1">OLI_INLINE </AttachmentLocation>
                        </Attachment>
                        <Attachment>
                             <AttachmentSysKey>2</AttachmentSysKey>
                             <Description>Additional Notes Important Considerations</Description>
                             <AttachmentData>This is the comments entered for the client</AttachmentData>
                             <AttachmentType tc="2">OLI_ATTACH_COMMENT </AttachmentType>
                             <AttachmentLocation tc="1">OLI_INLINE </AttachmentLocation>
                        </Attachment>
                        <Client>
                             <NumRelations>1</NumRelations>
                             <EstTaxBracket>10</EstTaxBracket>
                             <BrokerDealerInd tc="1">True</BrokerDealerInd>
                             <EstIncomeAmt>90000</EstIncomeAmt>
                             <PrimaryInvObjective tc="8">Income and Growth</PrimaryInvObjective>
                             <InvHorizonRangeMin>5</InvHorizonRangeMin>
                             <OLifEExtension VendorCode="05" ExtensionCode="Client">
                                  <ClientExtension>
                                       <RiskToleranceCode tc="3">Moderate</RiskToleranceCode>
                                       <FINRAAffiliationName>John Doe</FINRAAffiliationName>
                                       <Rank>
                                            <RankCategory tc="1009800001">Financial Goal</RankCategory>
                                            <TotalRankCode>5</TotalRankCode>
                                            <RankCode PurposeID="1009800016">6</RankCode>
                                            <RankCode PurposeID="35">6</RankCode>
                                            <RankCode PurposeID="2">6</RankCode>
                                            <RankCode PurposeID="1009800013">6</RankCode>
                                            <RankCode PurposeID="1009800014">6</RankCode>
                                            <RankCode PurposeID="5">6</RankCode>
                                            <RankCode PurposeID="1009800015">6</RankCode>
                                       </Rank>
                                  </ClientExtension>
                             </OLifEExtension>
                        </Client>
                        <EMailAddress>
                             <EMailType tc="1">Business</EMailType>
                             <AddrLine>[email protected]</AddrLine>
                        </EMailAddress>
                        <Risk>
                             <HHFamilyInsurance>
                                  <HHFamilyInsuranceSysKey>1</HHFamilyInsuranceSysKey>
                                  <DeclinedInd tc="0">False</DeclinedInd>
                                  <LineOfBusiness tc="1">Life Insurance</LineOfBusiness>
                             </HHFamilyInsurance>
                             <HHFamilyInsurance>
                                  <HHFamilyInsuranceSysKey>2</HHFamilyInsuranceSysKey>
                                  <DeclinedInd tc="0">False</DeclinedInd>
                                  <LineOfBusiness tc="1">Life Insurance</LineOfBusiness>
                             </HHFamilyInsurance>
                             <HHFamilyInsurance>
                                  <HHFamilyInsuranceSysKey>1</HHFamilyInsuranceSysKey>
                                  <DeclinedInd tc="0">False</DeclinedInd>
                                  <LineOfBusiness tc="3">Disability Insurance</LineOfBusiness>
                             </HHFamilyInsurance>
                             <HHFamilyInsurance>
                                  <HHFamilyInsuranceSysKey>1</HHFamilyInsuranceSysKey>
                                  <DeclinedInd tc="0">False</DeclinedInd>
                                  <LineOfBusiness tc="5">LTC Insurance</LineOfBusiness>
                             </HHFamilyInsurance>
                             <FinancialExperience>
                                  <InvestmentType tc="7">CD</InvestmentType>
                                  <YearsOfInvestmentExperience>1</YearsOfInvestmentExperience>
                                  <OLifEExtension VendorCode="05" ExtensionCode="FinancialExperience">
                                       <FinancialExperienceExtension>
                                            <AssetValue>30000</AssetValue>
                                       </FinancialExperienceExtension>
                                  </OLifEExtension>
                             </FinancialExperience>
                             <FinancialExperience>
                                  <InvestmentType tc="3">Stock</InvestmentType>
                                  <YearsOfInvestmentExperience>1</YearsOfInvestmentExperience>
                                  <OLifEExtension VendorCode="05" ExtensionCode="FinancialExperience">
                                       <FinancialExperienceExtension>
                                            <AssetValue>5000</AssetValue>
                                       </FinancialExperienceExtension>
                                  </OLifEExtension>
                             </FinancialExperience>
                             <FinancialExperience>
                                  <InvestmentType tc="2">Bond</InvestmentType>
                                  <YearsOfInvestmentExperience>6</YearsOfInvestmentExperience>
                                  <OLifEExtension VendorCode="05" ExtensionCode="FinancialExperience">
                                       <FinancialExperienceExtension>
                                            <AssetValue>50000</AssetValue>
                                       </FinancialExperienceExtension>
                                  </OLifEExtension>
                             </FinancialExperience>
                             <FinancialExperience>
                                  <InvestmentType tc="15">Variable Annuities</InvestmentType>
                                  <YearsOfInvestmentExperience>4</YearsOfInvestmentExperience>
                                  <OLifEExtension VendorCode="05" ExtensionCode="FinancialExperience">
                                       <FinancialExperienceExtension>
                                            <AssetValue>50000</AssetValue>
                                       </FinancialExperienceExtension>
                                  </OLifEExtension>
                             </FinancialExperience>
                             <FinancialExperience>
                                  <InvestmentType tc="6">Mutual Funds</InvestmentType>
                                  <YearsOfInvestmentExperience>0</YearsOfInvestmentExperience>
                                  <OLifEExtension VendorCode="05" ExtensionCode="FinancialExperience">
                                       <FinancialExperienceExtension>
                                            <AssetValue>0</AssetValue>
                                       </FinancialExperienceExtension>
                                  </OLifEExtension>
                             </FinancialExperience>
                             <FinancialExperience>
                                  <InvestmentType tc="1009800001">Cash</InvestmentType>
                                  <YearsOfInvestmentExperience>20</YearsOfInvestmentExperience>
                                  <OLifEExtension VendorCode="05" ExtensionCode="FinancialExperience">
                                       <FinancialExperienceExtension>
                                            <AssetValue>100000</AssetValue>
                                       </FinancialExperienceExtension>
                                  </OLifEExtension>
                             </FinancialExperience>
                             <FinancialExperience>
                                  <InvestmentType tc="2147483647">Other</InvestmentType>
                                  <YearsOfInvestmentExperience>0</YearsOfInvestmentExperience>
                                  <OLifEExtension VendorCode="05" ExtensionCode="FinancialExperience">
                                       <FinancialExperienceExtension>
                                            <AssetValue>0</AssetValue>
                                       </FinancialExperienceExtension>
                                  </OLifEExtension>
                             </FinancialExperience>
                        </Risk>
                        <Employment EmployerPartyID="Party4">
                             <OccupClass tc="1009800001">Employed</OccupClass>
                             <Occupation>Solution Architect</Occupation>
                             <EmployerName>AXA</EmployerName>
                             <YearsAtEmployment>15</YearsAtEmployment>
                        </Employment>
                        <GovtIDInfo>
                             <GovtID>123456789</GovtID>
                             <GovtIDTC tc="17">Passport</GovtIDTC>
                             <GovtIDExpDate>2015-08-24</GovtIDExpDate>
                             <Nation tc="1">USA</Nation>
                             <Jurisdiction tc="35">New Jersey</Jurisdiction>
                        </GovtIDInfo>
                   </Party>
                   <Party id="Party2">
                        <PartyTypeCode tc="1">Person</PartyTypeCode>
                        <PartySysKey>ProfileID456</PartySysKey>
                        <Person>
                             <FirstName>Jacqueline</FirstName>
                             <LastName>Doe</LastName>
                             <MarStat tc="1">Married</MarStat>
                             <Gender tc="2">Female</Gender>
                             <BirthDate>1975-05-07</BirthDate>
                             <EducationType tc="3">Associate Degree</EducationType>
                             <Citizenship tc="1">USA</Citizenship>
                             <DriversLicenseNum>D987654321</DriversLicenseNum>
                             <DriversLicenseState tc="35">New Jersey</DriversLicenseState>
                             <ImmigrationStatus tc="8">Citizen</ImmigrationStatus>
                             <DriversLicenseExpDate>2012-05-25</DriversLicenseExpDate>
                             <OLifEExtension VendorCode="05" ExtensionCode="Person">
                                  <PersonExtension>
                                       <NoDriversLicenseInd tc="0">False</NoDriversLicenseInd>
                                  </PersonExtension>
                             </OLifEExtension>
                        </Person>
                        <Address>
                             <Line1>125 Finn Lane</Line1>
                             <City>North Brunswick</City>
                             <AddressStateTC tc="35">New Jersey</AddressStateTC>
                             <Zip>08902</Zip>
                        </Address>
                        <Phone>
                             <PhoneTypeCode tc="1">Home</PhoneTypeCode>
                             <DialNumber>732456789</DialNumber>
                        </Phone>
                        <Risk>
                             <HHFamilyInsurance>
                                  <HHFamilyInsuranceSysKey>1</HHFamilyInsuranceSysKey>
                                  <DeclinedInd tc="0">False</DeclinedInd>
                                  <LineOfBusiness tc="1">Life Insurance</LineOfBusiness>
                             </HHFamilyInsurance>
                        </Risk>
                        <Employment>
                             <OccupClass tc="4">Unemployed</OccupClass>
                        </Employment>
                        <GovtIDInfo>
                             <GovtID>987654321</GovtID>
                             <GovtIDTC tc="17">Passport</GovtIDTC>
                             <GovtIDExpDate>2015-08-24</GovtIDExpDate>
                             <Nation tc="1">USA</Nation>
                             <Jurisdiction tc="35">New Jersey</Jurisdiction>
                        </GovtIDInfo>
                   </Party>
                   <Party id="Party3">
                        <PartyTypeCode tc="1">Person</PartyTypeCode>
                        <Person>
                             <FirstName>Joe</FirstName>
                             <LastName>Doe</LastName>
                             <Age>15</Age>
                        </Person>
                   </Party>
                   <Party id="Party4">
                        <Person/>
                        <Address>
                             <Line1>425 Washington Blvd.</Line1>
                             <City>Jersey City</City>
                             <AddressStateTC tc="35">New Jersey</AddressStateTC>
                             <Zip>07302</Zip>
                        </Address>
                   </Party>
                   <Relation OriginatingObjectID="Grouping1" id="Relation1" RelatedObjectID="Party1">
                        <OriginatingObjectType tc="16">Grouping</OriginatingObjectType>
                        <RelatedObjectType tc="6">Party</RelatedObjectType>
                        <RelationRoleCode tc="30">Member</RelationRoleCode>
                   </Relation>
                   <Relation OriginatingObjectID="Grouping1" id="Relation2" RelatedObjectID="Party2">
                        <OriginatingObjectType tc="16">Grouping</OriginatingObjectType>
                        <RelatedObjectType tc="6">Party</RelatedObjectType>
                        <RelationRoleCode tc="30">Member</RelationRoleCode>
                   </Relation>
                   <Relation OriginatingObjectID="Party1" id="Relation3" RelatedObjectID="Party3">
                        <OriginatingObjectType tc="6">Party</OriginatingObjectType>
                        <RelatedObjectType tc="6">Party</RelatedObjectType>
                        <RelationRoleCode tc="40">Dependant</RelationRoleCode>
                   </Relation>
                   <Relation OriginatingObjectID="Holding1" id="Relation4" RelatedObjectID="Party1">
                        <OriginatingObjectType tc="4">Holding</OriginatingObjectType>
                        <RelatedObjectType tc="6">Party</RelatedObjectType>
                        <RelationRoleCode tc="8">Owner</RelationRoleCode>
                   </Relation>
                   <Relation OriginatingObjectID="Holding1" id="Relation5" RelatedObjectID="Party2">
                        <OriginatingObjectType tc="4">Holding</OriginatingObjectType>
                        <RelatedObjectType tc="6">Party</RelatedObjectType>
                        <RelationRoleCode tc="184">Joint Owner</RelationRoleCode>
                   </Relation>
                   <Relation OriginatingObjectID="Form1" id="Relation6" RelatedObjectID="Party1">
                        <OriginatingObjectType tc="101">FormInstance</OriginatingObjectType>
                        <RelatedObjectType tc="6">Party</RelatedObjectType>
                        <RelationRoleCode tc="107">Form For</RelationRoleCode>
                   </Relation>
                   <FormInstance id="Form1">
                        <FormResponse>
                             <ResponseText>No</ResponseText>
                             <QuestionType tc="1009800001">Is the Client/Owner with an interest in the account either: (A) a senior military, governmental, or political official in a non-U.S. country, or (B) closely associated with or an immediate family member of such official?</QuestionType>
                        </FormResponse>
                        <FormResponse>
                             <ResponseText>Yes</ResponseText>
                             <QuestionType tc="1009800005">I am familiar with the product(s) being sold and have determined proper suitability. For deferred variable annuity purchases only: I have reasonable grounds for believing that the recommendations for this customer to purchase/exchange an annuity is suitable on the basis of the facts disclosed by the customer as to his/her investments, insurance products and financial situation and needs.</QuestionType>
                        </FormResponse>
                   </FormInstance>
              </OLifE>
         </TXLifeRequest>
    </TXLife>');
    /

    It's a really bad idea to assemble XML using strings and string concatenation in SQL or PL/SQL. First there is a 4K limit in SQL, and 32K limit in PL/SQL, which means you end up constructing the XML in chunks, adding uneccessary complications. 2nd you cannot confirm the XML is valid or well formed using external tools.
    IMHO it makes much more sense to keep the XML content seperated from the SQL / PL/SQL code
    When the XML can be stored a File System accessable from the database, The files can be loaded into the database using mechansims like BFILE.
    In cases where the XML must be staged on a remote file system, the files can be loaded into the database using FTP or HTTP and in cases where this is not an option, SQLLDR.
    -Mark

  • How to set SAXParser at command-line interface to create a large XML file

    Hi,
    I am trying to create a large XML file (more than 50 MB) by selecting from Oracle database but failed because of "out of memory" error. According to "Oracle XML Developer Guide", we should use SAXParser to parsing a large XML file. But there is no example to show how to set SAXParser at command-line
    Following is what I use to get xml files. It works only when the file is small.
    java OracleXML getXML -DateFormat -withDTD -rowsetTag PO_HDR -conn
    "jdbc:oracle:oci8:@server_name" -user "ID/password" "select * from table_name"
    When I set SAXParser at the way below,
    java oracle.xml.parser.v2.SAXParser OracleXML getXML -DateFormat -withDTD -rowsetTag PO_HDR -conn
    "jdbc:oracle:oci8:@server_name" -user "ID/password" "select * from table_name"
    it failed with the error message: "In class oracle.xml.parser.v2.SAXParser: void main(String argv[]) is not defined"
    Does anyone know how to solve the problem? I'll be appreciated very much for your help.
    Yi

    here are my ideas.
    register the xml schema.
    using xmldom, generate the desired xml output and return as xmltype.
    then you can use something like this to check.
    declare
    xmldoc xmltype ;
    begin
       -- populate xmldoc from you xmldom function
       -- validate against XML schema
       xmldoc.isSchemaValid(schema_url, root_element);
       if xmldoc.isSchemaValid = 1 then
            --valid schema
       else
            --invalid
       end if;
    end

Maybe you are looking for