Using Sqlldr to load VARRAYs!!!!!!!

HI,
I've created a collection type within the database the description of which reads as follows.....
SQL> desc LISTVARCHAR
LISTVARCHAR VARRAY(200) OF VARCHAR2(4000)
But when I try to insert a value of more than 255 characters using sqlldr, it seems to fail giving the following message, but works fine from within sqlplus!
Record 1: Rejected - Error on table TESTER, column COL1.
Field in data file exceeds maximum length
****** Sample Data:
|ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUV|
Shouldn't this Column take as many as 4000 characters for each element within that VARRAY? Please let me know if I'm missing anything.
Thanks a lot for your time
Chandra M.

You will able to find good information about it in this document :
http://download-east.oracle.com/docs/cd/B10501_01/server.920/a96652.pdf
Joel P�rez

Similar Messages

  • Using sqlldr to load XML files and the file name ?  or access the file name

    I can use sqlldr to load the XML files when I declare the target table of XMLTYPE, but I need to load the filename and a sequence also with the XML in a table so we can mark wether the file passed validation or not.
    something like ....
    Create table test1
    lobfn varchar(200),
    load_number number,
    XML_COL XMLTYPE
    --------------- here is my sqlldr command
    sqlldr xml_user/xml_user load_test1.ctl
    LOAD DATA
    INFILE *
    INTO TABLE test1
    append
    xmltype(XML_COL)
    lobfn FILLER char TERMINATED by ',',
    XML_COL LOBFILE(lobfn) TERMINATED BY EOF
    BEGINDATA
    filename1.xml
    filename2.xml
    filename64.xml
    sqlldr comes back and says "commit point reached - logical record count 64
    but when I select count(*) from test1; it returns 0 rows.
    and when I
    SELECT X.* FROM tst1 P2,
    XMLTable ( '//XMLRoot//APPLICATION'
    PASSING P2.XML_COL
    COLUMNS
    "LASTNAME" CHAR(31) PATH 'LASTNAME',
    "FIRSTNAME" CHAR(31) PATH 'FIRSTNAME'
    ) AS X;
    It tells me invalid identifier ,
    Do I need to use a function to get the XML_COL as a object_value ???
    But when I create the table like
    create table test1 of XMLTYPE;
    and use sqlldr it works, but I dont have the file name, or dont know how to access it ??
    and I can use
    SELECT X.* FROM tst1 P2,
    XMLTable ( '//XMLRoot//APPLICATION'
    PASSING P2.object_value
    COLUMNS
    "LASTNAME" CHAR(31) PATH 'LASTNAME',
    "FIRSTNAME" CHAR(31) PATH 'FIRSTNAME'
    ) AS X;

    BTW
    Here's a trivial example of what you appear to be trying to do..
    C:\xdb\otn\sqlLoader>sqlplus scott/tiger @createTable
    SQL*Plus: Release 10.2.0.2.0 - Production on Wed Aug 2 22:08:10 2006
    Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
    With the Partitioning, OLAP and Data Mining options
    SQL> DROP TABLE TEST_TABLE
      2  /
    Table dropped.
    SQL> CREATE TABLE TEST_TABLE
      2  (
      3    filename    VARCHAR2(32),
      4    file_content xmltype
      5  )
      6  /
    Table created.
    SQL> quit
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
    With the Partitioning, OLAP and Data Mining options
    C:\xdb\otn\sqlLoader>type sqlldr.ctl
    LOAD DATA
    INFILE 'filelist.txt'
       INTO TABLE TEST_TABLE
       FIELDS TERMINATED BY ','
        FILENAME       CHAR(32),
        FILE_CONTENT   LOBFILE(FILENAME) TERMINATED BY EOF
    C:\xdb\otn\sqlLoader>type filelist.txt
    testcase1.xml
    testcase2.xml
    C:\xdb\otn\sqlLoader>type testcase1.xml
    <foo/>
    C:\xdb\otn\sqlLoader>type testcase1.xml
    <foo/>
    C:\xdb\otn\sqlLoader>sqlldr userid=SCOTT/TIGER control=sqlldr.ctl log=sqlldr.log -direct
    SQL*Loader: Release 10.2.0.2.0 - Production on Wed Aug 2 22:08:11 2006
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Load completed - logical record count 2.
    C:\xdb\otn\sqlLoader>sqlplus scott/tiger
    SQL*Plus: Release 10.2.0.2.0 - Production on Wed Aug 2 22:08:18 2006
    Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
    With the Partitioning, OLAP and Data Mining options
    SQL> select * from TEST_TABLE
      2  /
    FILENAME
    FILE_CONTENT
    testcase1.xml
    <foo/>
    testcase2.xml
    <baa/>
    SQL>
    If you are interested in the 11g beta program please contact me directory at
    markDOTdrakeAToracleDOTcom

  • Using SQLLDR to load files

    I guess this is kind of a newbie question, so sorry in advance, but I can't figure this out from the documentation.
    I would like to use SQLLDR to load a series of files (a.txt, b.txt, c.txt, for example) to a CLOB. I want one file per row as each one is a separate document. I want everything in the file loaded up until EOF, then I want to move on to the next file.
    It sounds fairly simple, but so far I haven't been very successful. Could anyone post an example control file.
    Thanks.

    Use DBMS_LOB.LoadFromFile to do this (files must be accesible from the Oracle server to do this).
    Message was edited by:
    Kamal Kishore

  • How to use sqlldr for loading data in Oracle 10g xe.

    I want to load data using SQL*LOADER in Oracle DB from a .csv file but it doesn't seems to be working can anyony please help me.I am not get getting how to use sqlldr.
    in CMD in giving this command
    sqlldr hr/hr control='c:/data/record.ctr'
    record.ctr>>load data
    infile 'c:\data\record.csv'
              into table record
    fields terminated by "," optionally enclosed by '"'          
    ( Name,uday, hemant )
    sql table in data base>>CREATE TABLE "RECORD"
    (     "NAME" VARCHAR2(50),
         "UDAY" VARCHAR2(50),
         "HEMANT" VARCHAR2(50)
    record.csv>>name,uday,hemant
    c1,45454,84894
    c2,489654,21322
    can you please tell me how can i get this simple example run.

    C:\>sqlldr scott/tiger
    control = data.ctl
    SQL*Loader: Release 10.1.0.2.0 - Production on Thu Sep 14 17:06:46 2006
    Copyright (c) 1982, 2004, Oracle.  All rights reserved.
    Commit point reached - logical record count 3
    SQL> conn scott/tiger
    Connected.
    SQL> create table data (col1 varchar2(40),col2 varchar2(40),col3 varchar2(40));
    Table created.
    SQL> select * from data;
    COL1                 COL2                 COL3
    name                 uday                 hemant
    c1                   45454                84894
    c2                   489654               21322
    SQL>
    data.csv
    name,uday,hemant
    c1,45454,84894
    c2,489654,21322data.ctl
    load data
    infile 'c:\data.csv'
    append
    into table data
    fields terminated by ','
    optionally enclosed by '"'
    (col1,col2,col3)i hope it will solve ur problem

  • Using sqlldr to load CLOB data from DB2

    I am stuck trying to resolve this problem. I am migrating data from DB2 to Oracle. I used DB2 export to extract the data specifying lobsinfile clause. This created all the CLOB data in one file. So a typical record has a column with a reference to the CLOB data. "OUTFILE.001.lob.0.2880/". where OUTFILE.001.lob is the name specified in the export command and 0 is the starting position in the file and 2880 is the length of the first CLOB.
    When I try to load this data using sqlldr I'm getting a file not found.
    The control file looks something like this:
    clob_1 FILLER char(100),
    "DETAILS" LOBFILE(clob_1) TERMINATED BY EOF,
    I'm using Oracle 11gR2 and DB2 9.7.5
    Your help is appreciated.

    OK..here are additional details. Some names have changed but the idea is the same. Also the sqlldr is executing in the same directory as the data files and the control file
    Primary data file is VOIPCACHE.dat Secondary datafile (file with lob data) is VOIPCACHE.001.lob
    Control Fileload data
    infile 'VOIPCACHE.dat'
    badfile 'VOIPCACHE.bad'
    discardfile 'VOIPCACHE.dsc'
    replace into table VOIPCACHE
    fields terminated by ',' optionally enclosed by '"' TRAILING NULLCOLS
    (KEY1 "rtrim(:KEY1)",
    FIELD8,
    clob_1 FILLER char (100),
    "DATA" LOBFILE(clob_1) TERMINATED BY EOF)
    Snippet from Log file
    IELD7 NEXT * , O(") CHARACTER
    FIELD8 NEXT * , O(") CHARACTER
    CLOB_1 NEXT 100 , O(") CHARACTER
    (FILLER FIELD)
    "DATA" DERIVED * EOF CHARACTER
    Dynamic LOBFILE. Filename in field CLOB_1
    SQL*Loader-502: unable to open data file 'VOIPCACHE.001.lob.0.0/' for field "DATA" table VOIPCACHE
    SQL*Loader-553: file not found
    SQL*Loader-509: System error: No such file or directory
    SQL*Loader-502: unable to open data file 'VOIPCACHE.001.lob.0.47/' for field "DATA" table VOIPCACHE
    SQL*Loader-553: file not found
    SQL*Loader-509: System error: No such file or directory
    SQL*Loader-502: unable to open data file 'VOIPCACHE.001.lob.47.47/' for field "DATA" table VOIPCACHE
    SQL*Loader-553: file not found
    SQL*Loader-509: System error: No such file or directory
    SQL*Loader-502: unable to open data file 'VOIPCACHE.001.lob.94.58/' for field "DATA" table VOIPCACHE
    SQL*Loader-553: file not found
    SQL*Loader-509: System error: No such file or directory
    SQL*Loader-502: unable to open data file 'VOIPCACHE.001.lob.152.58/' for field "DATA" table VOIPCACHE
    SQL*Loader-553: file not found
    SQL*Loader-509: System error: No such file or directory
    SQL*Loader-502: unable to open data file 'VOIPCACHE.001.lob.210.206/' for field "DATA" table VOIPCACHE
    This is repeated for each record
    sqlldr command
    sqlldr userid=${SCHEMA}/${PASSWD}@$ORACLE_SID control=${CTLDIR}/${tbl}.ctl log=${LOGDIR}/${tbl}.log direct=true errors=50
    I dont think the variables are important here
    -EC

  • Using sqlldr to load old UNIFY data into oracle 11g

    I have a dump of an old UNIFY database whitch I need to build a controlfile to import to oracle using sql loader.
    the main problem is that the file is containing records for 64 tables
    the dumpfile is starting with the name of the table, and then data for each column in that table. like this:
    RSLT|0|26/09/2005|1281|2|LD|S1|0|0|  223|223.000000|Centra|27/09/2005|10:13|Centra|27/09/2005|10:13|3|0|3984|180|24069844193|379650048|247075485|134233305|0|
    SMPL|0|26/09/2005|1281|3||5|ALLE|2|1|177|0||26/09/2005|**:**|svi2|||**/**/****|**:**||0||0|0|**/**/****|00:01||286138573|2560|
    I have build the ny datamodel in oracle, and it is the same as in the old UNIFY system. so that is not a problem.
    but HOW do I tell sqlldr that there is not data from just one table but 64..??
    the tablenames and how to difference them is the main problem..
    This is an urgent issue.. I need helt fast.
    any suggestions?

    Hi,
    You can do something like that
    --- Control file--------------
    cat aa.ctl
    LOAD DATA
    INFILE '/home/oracle/MYSHELL/aa.txt'
    TRUNCATE
    INTO TABLE RSLT
    WHEN DBNAME = 'RSLT'
    FIELDS TERMINATED BY '|'
    DBNAME,
    col_1,
    col_2,
    col_3,
    col_4
    INTO TABLE SMPL
    WHEN DBNAME = 'SMPL'
    FIELDS TERMINATED BY '|'
    DBNAME position(1),
    col_1,
    col_2,
    col_3,
    col_4
    -- dat file----------
    cat aa.txt
    RSLT|0|26/09/2005|1281|2
    SMPL|0|26/09/2005|1281|3
    SQL> host sqlldr me/** control=aa.ctl
    SQL*Loader: Release 11.2.0.2.0 - Production on Wed Aug 14 02:15:37 2013
    Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
    Commit point reached - logical record count 2
    SQL> select * from SMPL;
    DBNAME     COL_1      COL_2                COL_3      COL_4
    SMPL       0          26/09/2005           1281       3
    SQL> select * from RSLT;
    DBNAME     COL_1      COL_2                COL_3      COL_4
    RSLT       0          26/09/2005           1281       2
    HTH

  • Error when load sptial data by using sqlldr

    Currently, I have a shapeFile, so I have used shp2sdo tool to convert shapeFile to Oracle Spatial database. But when using sqlldr tool, I get the following errors:
    ----- Log file content ------
    SQL*Loader: Release 10.2.0.1.0 - Production on Sat Mar 24 09:13:07 2007
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Control File: /home/oracle/street.ctl
    Data File: /home/oracle/street.ctl
    Bad File: /home/oracle/street.bad
    Discard File: none specified
    (Allow all discards)
    Number to load: ALL
    Number to skip: 0
    Errors allowed: 50
    Bind array: 64 rows, maximum of 10000000 bytes
    Continuation: 1:1 = 0X23(character '#'), in next physical record
    Path used: Conventional
    Table STREET, loaded from every logical record.
    Insert option in effect for this table: TRUNCATE
    TRAILING NULLCOLS option in effect
    Column Name Position Len Term Encl Datatype
    ID FIRST * | CHARACTER
    NAME NEXT * | CHARACTER
    NULL if NAME = BLANKS
    GEOM DERIVED * COLUMN OBJECT
    *** Fields in GEOM
    SDO_GTYPE NEXT * | CHARACTER
    SDO_SRID NEXT * | CHARACTER
    SDO_ELEM_INFO DERIVED * VARRAY
    Terminator string : '|/'
    *** Fields in GEOM.SDO_ELEM_INFO
    X FIRST * | CHARACTER
    *** End of fields in GEOM.SDO_ELEM_INFO
    SDO_ORDINATES DERIVED * VARRAY
    Terminator string : '|/'
    *** Fields in GEOM.SDO_ORDINATES
    X FIRST * | CHARACTER
    *** End of fields in GEOM.SDO_ORDINATES
    *** End of fields in GEOM
    Record 1: Rejected - Error on table STREET, column GEOM.SDO_ELEM_INFO.X.
    error converting data
    ORA-01722: invalid number
    Record 2: Rejected - Error on table STREET, column GEOM.SDO_ELEM_INFO.X.
    error converting data
    ORA-01722: invalid number
    Record 3: Rejected - Error on table STREET, column GEOM.SDO_ELEM_INFO.X.
    error converting data
    ORA-01722: invalid number
    Record 4: Rejected - Error on table STREET, column GEOM.SDO_ELEM_INFO.X.
    error converting data
    ORA-01722: invalid number
    Record 5: Rejected - Error on table STREET, column GEOM.SDO_ELEM_INFO.X.
    error converting data
    ORA-01722: invalid number
    Record 6: Rejected - Error on table STREET, column GEOM.SDO_ELEM_INFO.X.
    error converting data
    ORA-01722: invalid number
    Record 7: Rejected - Error on table STREET, column GEOM.SDO_ELEM_INFO.X.
    error converting data
    ORA-01722: invalid number
    -------- this is my control file ---------------
    LOAD DATA
    INFILE *
    TRUNCATE
    CONTINUEIF NEXT(1:1) = '#'
    INTO TABLE STREET
    FIELDS TERMINATED BY '|'
    TRAILING NULLCOLS (
    ID,
    NAME      NULLIF NAME = BLANKS,
    GEOM COLUMN OBJECT
    SDO_GTYPE INTEGER EXTERNAL,
    SDO_SRID INTEGER EXTERNAL,
    SDO_ELEM_INFO VARRAY TERMINATED BY '|/'
    (X FLOAT EXTERNAL),
    SDO_ORDINATES VARRAY TERMINATED BY '|/'
    (X FLOAT EXTERNAL)
    BEGINDATA
    1|A|
    #2002|8307|
    #1|2|1|/
    #106.408265|10.461029|106.409036|10.461789|106.409561|10.462392|
    #106.410520|10.463381|106.411527|10.464443|106.412017|10.464956|
    #106.412563|10.465536|106.413615|10.466630|106.414564|10.467624|
    #106.415333|10.468458|106.415749|10.468869|106.416368|10.469524|
    #106.417304|10.470526|106.418107|10.471318|/
    2|B|
    #2002|8307|
    #1|2|1|/
    #106.410156|10.461118|106.406821|10.463133|106.405549|10.463909|/
    3|C|
    #2002|8307|
    #1|2|1|/
    #106.405221|10.464159|106.404133|10.464773|106.403267|10.465291|
    #106.402926|10.465558|106.402158|10.465981|/
    4|D|
    #2002|8307|
    #1|2|1|/
    #106.402341|10.460738|106.403378|10.461422|106.403476|10.461504|
    #106.403562|10.461580|106.403633|10.461660|106.403768|10.461844|
    #106.404904|10.463687|106.405034|10.463842|106.405130|10.463947|
    #106.405221|10.464017|/
    5|E|
    #2002|8307|
    #1|2|1|/
    #106.405443|10.463815|106.406002|10.462394|/
    Have anyone can help me? Thanks

    I've seen folks work around similar problems by temporarily changing their NLS parameters (warning: you probably don't want to do this on a heavily used or production system). I know you said you changed them, but it might be worth another try.
    On NT save the registry entry for NLS_LANG. I think it is at:
    HKEY_LOCAL_MACHINE->SOFTWARE->ORACLE->KEY_YOURORACLEHOME
    Make the NLS_LANG registry value AMERICAN_AMERICA.WE8MSWIN1252
    Restart the database.
    Load the data
    Reset the registry entry
    Restart the database.

  • Getting ORA-22805 when trying to load XML file using SQLLDR

    I'm trying to learn the basics of XML since we'll be getting XML files in the near future. I'm using one of the sample schemas that comes with XMLSPY. I loaded this schema into an 11g Oracle DB using XMLSPY:
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- edited with XML Spy v4.0 NT beta 1 build Jun 13 2001 (http://www.xmlspy.com) by Alexander Falk (Altova, Inc.) -->
    <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:ipo="http://www.altova.com/IPO" targetNamespace="http://www.altova.com/IPO" elementFormDefault="unqualified" attributeFormDefault="unqualified">
         <annotation>
              <documentation>
    International Purchase order schema for Example.com
    Copyright 2000 Example.com. All rights reserved.
    </documentation>
         </annotation>
         <!-- include address constructs -->
         <include schemaLocation="address.xsd"/>
         <element name="purchaseOrder" type="ipo:PurchaseOrderType"/>
         <element name="comment" type="string"/>
         <complexType name="PurchaseOrderType">
              <sequence>
                   <element name="shipTo" type="ipo:Address"/>
                   <element name="billTo" type="ipo:Address"/>
                   <element ref="ipo:comment" minOccurs="0"/>
                   <element name="Items" type="ipo:Items"/>
              </sequence>
              <attribute name="orderDate" type="date"/>
         </complexType>
         <complexType name="Items">
              <sequence>
                   <element name="item" minOccurs="0" maxOccurs="unbounded">
                        <complexType>
                             <sequence>
                                  <element name="productName" type="string"/>
                                  <element name="quantity">
                                       <simpleType>
                                            <restriction base="positiveInteger">
                                                 <maxExclusive value="100"/>
                                            </restriction>
                                       </simpleType>
                                  </element>
                                  <element name="price" type="decimal"/>
                                  <element ref="ipo:comment" minOccurs="0"/>
                                  <element name="shipDate" type="date" minOccurs="0"/>
                             </sequence>
                             <attribute name="partNum" type="ipo:Sku"/>
                        </complexType>
                   </element>
              </sequence>
         </complexType>
         <simpleType name="Sku">
              <restriction base="string">
                   <pattern value="\d{3}-[A-Z]{2}"/>
              </restriction>
         </simpleType>
    </schema>
    Then I created an XMLType table:
    CREATE TABLE purchaseOrder OF XMLType
    XMLSCHEMA "ipo.xsd" ELEMENT "purchaseOrder"
    I'm trying to load the sample XML file ipo.xml into purchaseOrder using SQLLDR. This is ipo.xml:
    <?xml version="1.0"?>
    <!-- edited with XMLSPY v2004 rel. 4 U (http://www.xmlspy.com) by Mr. Nobody (Altova GmbH) -->
    <ipo:purchaseOrder xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ipo="http://www.altova.com/IPO" orderDate="1999-12-01" xsi:schemaLocation="http://www.altova.com/IPO
    ipo.xsd">
         <shipTo export-code="1" xsi:type="ipo:EU-Address">
              <ipo:name>Helen Zoe</ipo:name>
              <ipo:street>47 Eden Street</ipo:street>
              <ipo:city>Cambridge</ipo:city>
              <ipo:postcode>126</ipo:postcode>
         </shipTo>
         <billTo xsi:type="ipo:US-Address">
              <ipo:name>Robert Smith</ipo:name>
              <ipo:street>8 Oak Avenue</ipo:street>
              <ipo:city>Old Town</ipo:city>
              <ipo:state>AK</ipo:state>
              <ipo:zip>95819</ipo:zip>
         </billTo>
         <Items>
              <item partNum="833-AA">
                   <productName>Lapis necklace</productName>
                   <quantity>2</quantity>
                   <price>99.95</price>
                   <ipo:comment>Need this for the holidays!</ipo:comment>
                   <shipDate>1999-12-05</shipDate>
              </item>
              <item partNum="748-OT">
                   <productName>Diamond heart</productName>
                   <quantity>1</quantity>
                   <price>248.90</price>
                   <ipo:comment>Valentine's day packaging.</ipo:comment>
                   <shipDate>2000-02-14</shipDate>
              </item>
              <item partNum="783-KL">
                   <productName>Uncut diamond</productName>
                   <quantity>7</quantity>
                   <price>79.90</price>
                   <shipDate>2000-01-07</shipDate>
              </item>
              <item partNum="238-KK">
                   <productName>Amber ring</productName>
                   <quantity>3</quantity>
                   <price>89.90</price>
                   <ipo:comment>With no inclusions, please.</ipo:comment>
                   <shipDate>2000-01-07</shipDate>
              </item>
              <item partNum="229-OB">
                   <productName>Pearl necklace</productName>
                   <quantity>1</quantity>
                   <price>4879.00</price>
                   <shipDate>1999-12-05</shipDate>
              </item>
              <item partNum="128-UL">
                   <productName>Jade earring</productName>
                   <quantity>5</quantity>
                   <price>179.90</price>
                   <shipDate>2000-02-14</shipDate>
              </item>
         </Items>
    </ipo:purchaseOrder>
    This is what's in the control file:
    LOAD DATA
    INFILE *
    INTO TABLE purchaseOrder TRUNCATE
    xmltype(xmldata)
    FIELDS
    xmldata LOBFILE (CONSTANT ipo.xml)
    BEGINDATA
    0
    The load fails with:
    Record 1: Rejected - Error on table PURCHASEORDER.
    ORA-22805: cannot insert NULL object into object tables or nested tables
    Another question I have is, how do we know how many records (0's) to specify in the control file? In this case there's only one but when real files are used we won't know how many are in the file.
    Thanks for your help!

    The concept was "Don't use SQL*Loader to parse XML".
    You can use SQL*Loader to load an entire XML document into the DB. That is fine. You can do the same via BFILENAME to read in files from disk as well.
    If you want to parse XML, do that from within Oracle via PL/SQL and/or SQL. The solution depends upon your version of Oracle and what is good enough for you in terms of performance.
    So the basics are
    a) How am I getting the information?
    b) How am I getting in into Oracle?
    c) How do I want to parse it?
    As I see the schema, it only allows for one ipo:purchaseOrder node in the document, since that is the root node. If you have multiple in the incoming file, you no longer have valid XML, both per the schema and because you have no single root node. You have an XML fragment, which must be treated different.
    Just trying to understand the question since I now realize it does not agree with what the schema in your initial example shows.

  • Loading a table from multiple input files using sqlldr

    Hi,
    For my project i need to load into a table by joining two input files using sqlldr. For example,
    I have a file1, which has values
    name,salary,ssn
    and file2 which has values for
    ssn,location,country
    now i need to load these values into a table say employee_information by joining both input files. both input files can be joined using ssn as common field.
    Any idea how to do this??
    Thanks in advance
    Satya.

    Hi,
    What is the size of the files. If possible mail me the sample files, And the structure of table. Is the <ssn> from first file and second will have seperate columns in the table or we have to merge it.
    SKM

  • Load Multiple Table using SQLLDR

    Hi,
    We are trying to Load Multiple Table using SQLLDR in same loading session.
    Here's a snippet of our script:
    LOAD DATA INFILE '/u07/dd/yyyy_mm_dd.dat'
    append INTO TABLE table1
    WHEN STORE_NO != ' '
    STORE_NO position(1:5) ,
    TR_DATE position(6:27) DATE "mm/dd/yy
    truncate INTO TABLE table2
    WHEN STORE_NO != ' '
    STORE_NO position(1:5) ,
    TR_DATE position(6:27) DATE "mm/dd/yy
    Now upon execution this gives an error saying truncate shouldn't be present before 2nd INTO Clause. The script runs fine if we do same operation say Append / Replcae / Truncate on both tables. My Question here is can we have SQLLDR perform two diff operations (Append & Truncate in our case) in one session?
    Thanks
    Chinmay
    PS: Referred to http://www.orafaq.com/wiki/SQL*Loader_FAQ#Can_one_load_data_from_multiple_files.2F_into_multiple_tables_at_once.3F already

    No.
    did you read the syntax diagram and the paragraph below:
    "When you are loading a table, you can use the INTO TABLE clause to specify a table-specific loading method (INSERT, APPEND, REPLACE, or TRUNCATE) that applies only to that table. That method overrides the global table-loading method. The global table-loading method is INSERT, by default, unless a different method was specified before any INTO TABLE clauses."

  • Example of loading systimestamp in a timestamp field using sqlldr

    can anyone provide me with an working example of loading a default value of systimestamp in a timestamp field using sqlldr - control file

    Example:
    LOAD DATA
    INFILE 'vendor.dat'
    BADFILE 'vendor.bad'
    DISCARDFILE 'vendor.dsc'
    REPLACE
    INTO TABLE VENDORS
    (     ADVE_VENDOR_NO POSITION(002:011) CHAR,     
         ADVE_VENDOR_SUFFIX POSITION(015:016) INTEGER EXTERNAL NULLIF adve_vendor_suffix ='**',     
         ADVE_VENDOR_NAME POSITION(020:059) CHAR,
         ADVE_STREET POSITION(063:102) CHAR NULLIF adve_street=BLANKS,
         ADVE_CITY POSITION(106:120) CHAR NULLIF adve_city=BLANKS,
         ADVE_STATE POSITION(134:135) CHAR NULLIF adve_state=BLANKS,
         ADVE_ZIP POSITION(139:148) CHAR NULLIF adve_zip=BLANKS,
         ADVE_COUNTRY POSITION(152:154) CHAR NULLIF adve_country=BLANKS,
         ADVE_PHONE_AREA_CODE POSITION(158:160) CHAR NULLIF adve_phone_area_code=BLANKS,
         ADVE_PHONE POSITION(164:171) CHAR NULLIF adve_phone=BLANKS,
         ADVE_FAX_AREA_CODE POSITION(175:177) CHAR NULLIF adve_fax_area_code=BLANKS,
         ADVE_FAX POSITION(181:188) CHAR NULLIF adve_fax=BLANKS,
         ADVE_EMAIL POSITION(192:231) CHAR NULLIF adve_email=BLANKS,
         ADVE_CONTACT POSITION(235:274) CHAR NULLIF adve_contact=BLANKS,
         ADVE_VENDOR_HDR_STATUS POSITION(278:278) CHAR NULLIF adve_vendor_hdr_status=BLANKS,
         ADVE_VENDOR_DTL_STATUS POSITION(282:282) CHAR NULLIF adve_vendor_dtl_status=BLANKS,
         ADVE_REGISTER_ID POSITION(286:286) CHAR NULLIF adve_register_id=BLANKS,
         ADVE_STATUS_DATE POSITION(290:297) DATE "YYYYMMDD",
         ADVE_CREATED_DATE POSITION(301:308) DATE "YYYYMMDD",
         ADVE_FEDTAX_SSN_IND POSITION(312:312) CHAR NULLIF adve_fedtax_ssn_ind=BLANKS,
         ADVE_FEDTAX_SSN_NO POSITION(316:324) CHAR NULLIF adve_fedtax_ssn_ind=BLANKS,
         ADVE_VENDOR_TYPE POSITION(328:328) CHAR NULLIF adve_vendor_type=BLANKS,
         ADVE_DATE_CREATED SYSDATE,
         ADVE_CREATED_BY CONSTANT TEST)

  • Loading Using SQLLDR

    Hi
    I am loading text data in to 10g using sqlldr utility, but rows having some null values fields cannot loaded.
    So i want to load these rows as well. plz help me in this situation.
    regards!

    Please take a look at
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:533222350291
    It should work with this loader contol file:
    load data
    infile 'c:\loading\cases.txt'
    insert into table cfmis.loading
    fields terminated by X'9'
    optionally enclosed by '"'
    trailing nullcols
    (sno integer external,caseno integer external,caseyear char,instdate date 'DD-MM-YY',title char)
    {code}
    Also you should take a look at your table constraints (not null).
    Edited by: hm on 18.10.2010 22:30                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Data error while loading data using SQLLDR

    Hi Gurus,
    Kindly let em know the possible reasons for getting the below error returned by SQLLDR after loading data:
    x no of rows not loaded due to data errors in SQLLDR
    Could it be due to issues in control file?

    you'll find it well explained here :
    http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14215/part_ldr.htm#i436326
    http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14215/ldr_concepts.htm#i1004846

  • How to show an image stored by using SQLLDR as BLOB in ORACLE 10g

    Hi!
    i used SQLLDR to upload images from localhost to my oracle db,
    i saves theme as BLOB`s.
    my problem is:
    i can not view them correctly, showing it using the code below, i get:
    gtìSNEvR=Cm¯ö¾ÆTÿmÖØÏs_û«¬ú ÿSê¯HwýÓ ›[[ü/ñŠÝßSº‡—¢
    does any know what to do?? can help me??
    thank you!
    A.H.S.
    <?php
    echo "<p>Attempting database connection...</p></p>";
    $db_conn = ocilogon("username", "password", "ORACLE_SID");
    if (!$db_conn)
    echo "...FAILED. Check the username, passwd, dbstring given in this script are valid or not.</p>";
    if (OCIError($db_conn))
    $erra=OCIError($db_conn);
    dodberror("SQL Error: $erra $erra[message]");
            exit;
          else
            echo "<p>Connected...</p></p>";
    $table_name="images";
    $stmt = ociparse($db_conn, "select * from $table_name" );
         if (!$stmt)
            echo '<p>parsing error</p></p>';
          if (!ociexecute($stmt,OCI_DEFAULT))
            echo "<font color='red'><p>query execute error!</p></font>";
           echo "<table border=1 cellspacing='0' width='50%'>\n";
           $ncols = OCINumCols($stmt);
           echo "<tr>\n";
           for ($i = 1; $i <= $ncols; $i++) {
                $column_name  = OCIColumnName($stmt,$i);
                echo "<td><b>$column_name</b></td>\n";
           while (OCIFetch($stmt))
               echo "<tr>\n";
            for ($i = 1; $i <= $ncols; $i++)
              $column_name  = OCIColumnName($stmt,$i);
              $column_value = OCIResult($stmt,$i);
              if($column_name=="DATA")  
              //Header("content-type: image/jpg");
               $image = "$column_value->load()";
               echo $column_value;    // gives OBJECT!
               echo "<td><img src='$image' width='48' height='48' align='middle' border='0' alt='not found'> </td>\n";
              //echo "<td><img src='$column_value.jpg' width='48' height='48' a-lign='middle' border='0' alt='not found'> </td>\n"; //works 100%
              //$c1 = '<IMG height=128 width=600 SRC="http://host/' . $row[2] . '">';
                //if ($row[image]) { 
              //header("Content-Type: $row[image_type]"); 
              //print "$row[image]";
                else
              echo "<td><b>$column_value</b></td>\n";
            echo "</tr>\n";
          echo "</tr>\n";
           echo "</table>\n";
          OCIFreeStatement($stmt);
          OCILogoff($db_conn);
        ?>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Do you need to uncomment one of the header() functions? Make sure
    it is called before any text or whitespace is sent.
    Look at the example in PHP 5 Code to Upload and Retrieve an Image (aka BLOB) with Oracle
    -- cj

  • Using sqlldr when source data column is 4000 chars

    I'm trying to load some data using sqlldr.
    The table looks like this:
    col1 number(10) primary key
    col2 varchar2(100)
    col3 varchar2(4000)
    col4 varchar2(10)
    col5 varchar2(1)
    ... and some more columns ...
    For current purposes, I only need to load columns col1 through col3. The other columns will be NULL.
    The source text data looks like this (tab-delimited) ...
    col1-text<<<TAB>>>col2-text<<<TAB>>>col3-text
    more-col3-text
    more-col3-text
    more-col3-text
    more-col3-text
    more-col3-text
    END-OF-RECORD
    There's nothing special about the source data for col1 and col2.
    But the data for col3 is (usually) much longer than 4000 chars, so I just need to truncate it to fit varchar2(4000), right?
    The control file looks like this ...
    LOAD DATA
    INFILE 'load.dat' "str 'END-OF-RECORD'"
    TRUNCATE
    INTO TABLE my_table
    FIELDS TERMINATED BY "\t"
    OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    col1 "trim(:col1)",
    col2 "trim(:col2)",
    col3 char(10000) "substr(:col3,1,4000)"
    I made the column 3 specification char(10000) to allow sqlldr to read text longer than 4000 chars.
    And the subsequent directive is meant to truncate it to 4000 chars (to fit in the table column).
    But I get this error ...
    Record 1: Rejected - Error on table COL3.
    ORA-01461: can bind a LONG value only for insert into a LONG column
    The only solution I found was ugly.
    I changed the control file to this ...
    col3 char(4000) "substr(:col3,1,4000)"
    And then I hand-edited (truncated) the source data for column 3 to be shorter than 4000 chars.
    Painful and tedious!
    Is there a way around this difficulty?
    Note: I cannot use a CLOB for col3. There's no option to change the app, so col3 must remain varchar2(4000).

    You can load the data into a staging table with a clob column, then insert into your target table using substr, as demonstated below. I have truncated the data display to save space.
    -- load.dat:
    1     col2-text     col3-text
    more-col3-text
    more-col3-text
    more-col3-text
    more-col3-text
    more-col3-text
    XYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
    YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
    END-OF-RECORD-- test.ctl:
    LOAD DATA
    INFILE 'load.dat' "str 'END-OF-RECORD'"
    TRUNCATE
    INTO TABLE staging
    FIELDS TERMINATED BY X'09'
    OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    col1 "trim(:col1)",
    col2 "trim(:col2)",
    col3 char(10000)
    SCOTT@orcl_11gR2> create table staging
      2    (col1 varchar2(10),
      3       col2 varchar2(100),
      4       col3 clob)
      5  /
    Table created.
    SCOTT@orcl_11gR2> host sqlldr scott/tiger control=test.ctl log=test.log
    SCOTT@orcl_11gR2> select * from staging
      2  /
    COL1
    COL2
    COL3
    1
    col2-text
    col3-text
    more-col3-text
    more-col3-text
    more-col3-text
    more-col3-text
    more-col3-text
    XYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
    YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
    1 row selected.
    SCOTT@orcl_11gR2> create table my_table
      2    (col1 varchar2(10) primary key,
      3       col2 varchar2(100),
      4       col3 varchar2(4000),
      5       col4 varchar2(10),
      6       col5 varchar2(1))
      7  /
    Table created.
    SCOTT@orcl_11gR2> insert into my_table (col1, col2, col3)
      2  select col1, col2, substr (col3, 1, 4000) from staging
      3  /
    1 row created.
    SCOTT@orcl_11gR2> select * from my_table
      2  /
    COL1
    COL2
    COL3
    COL4       C
    1
    col2-text
    col3-text
    more-col3-text
    more-col3-text
    more-col3-text
    more-col3-text
    more-col3-text
    XYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
    YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
    1 row selected.

Maybe you are looking for

  • How remove space in column ?

    In a.newunit column I have spaces before data. I tried to use TRIM and LTRIM -- but doesn't work :( What else I can use? SELECT LTRIM(u.scode), LTRIM(a.newunit) FROM unit u, aaa_test a WHERE LTRIM(u.scode) = LTRIM(a.newunit)

  • Set proprty as value of another property

    my datacollector bean has refrenc of type data with 4 different properties <jsp:useBean id="data" class="com.custom.util.DataCollector" scope="request"/>         <c:set target="${data}" property="IP1" value="${param.subnet1}" />         <c:set target

  • Attachments in Shopping Cart

    Hi guys, We are using a SRM 5.0 (SAPKIBKT11) with a R/3 4.6C Backend system (Support Package 47). We are trying to transfer a Word-document as an attachment  in a SHC to R/3 Backend Pur.Req. As far as we know, we followed the necesary steps documente

  • Error message: 'you can't open the application because the Classic environment is no longer supported'

    I get the error message 'you can't open the application because the Classic environment is no longer supported', when will this issue be fixed? I need to use a program to analyse videos called 'J watcher' that is vital for my thesis. It worked in the

  • SIP      Where can I find (JSR 180 Package - the actual jar files)

    Hey guys I have been looking for this for hours I'm up to my ears in lovely documentation and samples where can I find the actual jar file of an implementation of the SIP API for J2ME. Thank you in advnace Brian