Loading Nested table with SQL Loader

We have 15 nested tables in an table. Need help in creating a contol file. Tried with the syntax of object collection and didn't work. Can any none share the syntax please.
-- Thanks,
Phani Adusumilli

Thanks Srini and Zoltan.
I am able to figure out, here is the example with one nested table.
CREATE OR REPLACE TYPE feature_count_type AS OBJECT (
feature_type VARCHAR2(60),
occurs INTEGER
CREATE OR REPLACE TYPE feature_count_ntbl
AS TABLE OF feature_count_type;
CREATE TABLE PHANI_ADUSUMILLI(
state VARCHAR2(2),
county VARCHAR2(20),
feature_count feature_count_ntbl
) NESTED TABLE feature_count
STORE AS nested_feature_count_table;
LOAD DATA
INFILE *
TRUNCATE INTO TABLE PHANI_ADUSUMILLI
county CHAR TERMINATED BY ',' ENCLOSED BY '"',
element_count FILLER INTEGER EXTERNAL TERMINATED BY ',',
feature_count NESTED TABLE COUNT(element_count)
     dummy_name COLUMN OBJECT
     feature_type CHAR TERMINATED BY ',',
     occurs INTEGER EXTERNAL TERMINATED BY ','
state CHAR TERMINATED BY ','
BEGINDATA
"Alger",5,lake,213,stream,88,falls,18,bay,11,island,5,MI
"Marquette",6,lake,293,stream,145,falls,5,bay,8,island,5,summit,23,MI
"Keweenaw",3,lake,86,falls,1,summit,16,MI

Similar Messages

  • Loading multiple tables with SQL Loader

    Hi,
    I want to load multiple tables from a single data file using SQL Loader.
    Here's the basic idea of what I want. Let's say I have two tables, table =T1
    and table T2:
    SQL> desc T1;
    COL1 VARCHAR2(20)
    COL2 VARCHAR2(20)
    SQL> desc T2;
    COL1 VARCHAR2(20)
    COL2 VARCHAR2(20)
    COL3 VARCHAR2(20)
    My data file, test.dat, looks like this:
    AAA|KBA
    BBR|BBCC|CCC
    NNN|BBBN|NNA
    I want to load the first record into T1, and the second and third record load into T2. How do I set up my control file to do that?
    Thank!

    Tough Job
    LOAD DATA
    truncate
    INTO table t1
    when col3 = 'dummy'
    FIELDS TERMINATED BY '|'
    TRAILING NULLCOLS
    (col1,col2,col3 filler char nullif col3='dummy')
    INTO table t2
    when col3 != 'dummy'
    FIELDS TERMINATED BY '|'
    (col1,col2,col3 nullif col3='dummy')
    This will load t2 tbl but not t1.
    T1 Filler col3 is not accepting nullif. Its diff to compare columns have null using when condition. If i find something i will let you know.
    Can you seperate records into 2 file. Will a UNIX command work for you which will seperate 2col and 3col record types for you. and then you can execute 2 controlfiles on it.
    Thanks,
    http://www.askyogesh.com

  • How can I load data into table with SQL*LOADER

    how can I load data into table with SQL*LOADER
    when column data length more than 255 bytes?
    when column exceed 255 ,data can not be insert into table by SQL*LOADER
    CREATE TABLE A (
    A VARCHAR2 ( 10 ) ,
    B VARCHAR2 ( 10 ) ,
    C VARCHAR2 ( 10 ) ,
    E VARCHAR2 ( 2000 ) );
    control file:
    load data
    append into table A
    fields terminated by X'09'
    (A , B , C , E )
    SQL*LOADER command:
    sqlldr test/test control=A_ctl.txt data=A.xls log=b.log
    datafile:
    column E is more than 255bytes
    1     1     1     1234567------(more than 255bytes)
    1     1     1     1234567------(more than 255bytes)
    1     1     1     1234567------(more than 255bytes)
    1     1     1     1234567------(more than 255bytes)
    1     1     1     1234567------(more than 255bytes)
    1     1     1     1234567------(more than 255bytes)
    1     1     1     1234567------(more than 255bytes)
    1     1     1     1234567------(more than 255bytes)

    Check this out.
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96652/ch06.htm#1006961

  • Loading multiple files with SQL Loader

    Hello.
    I will appreciate your recommendation about the way to load multiple files (to multiple tables) using SQL Loader with only one Control file.
    file1 to load to Table1, file2 to load to Table2 etc.
    How the Control file should look like?
    I was looking on Web, but didn't find exactly what I need.
    Thanks!

    Ctl File : myctl.ctl
    ---------- Start ---------
    LOAD DATA
    INFILE 'F:\sqlldr\abc1.dat'
    INFILE 'F:\sqlldr\abc2.dat'
    INTO TABLE hdfc1
    (TRANS_DATE CHAR,
    NARRATION CHAR,
    VALUE_DATE CHAR,
    DEBIT_AMOUNT INTEGER,
    CREDIT_AMOUNT INTEGER,
    CHQ_REF_NUMBER CHAR,
    CLOSING_BALANCE CHAR)
    INTO TABLE hdfc2
    (TRANS_DATE CHAR,
    NARRATION CHAR,
    VALUE_DATE CHAR,
    DEBIT_AMOUNT INTEGER,
    CREDIT_AMOUNT INTEGER,
    CHQ_REF_NUMBER CHAR,
    CLOSING_BALANCE CHAR)
    -----------End-----------
    Sqlldr Command
    sqlldr scott/tiger@dbtalk control=F:\sqlldr\myctl.ctl log=F:\sqlldr\ddl_file1.txt
    Regards,
    Abu

  • Loading a big table with SQL*LOADER

    I'm loading thru sql*loader a big quantity of data, The number of rows that I need to load to oracle table is 339'582.194. The inconvenient is that I want to load this data more quickly.
    Somebody knows how I can accelerate this process. Or somebody knows other way for to do this more efficiently.
    Thanks.

    Dirct Path?

  • How can I load this XML with sql loader ?

    Hi,
    Im try to load a XML file into a XML table:
    Create table TEST of XMLTYPE;
    XML file is something like this:
    <!DOCTYPE list SYSTEM "myfile.dtd">
    <list>
    <item id = 1> lot of tags an info here </item>
    <item id = 9000> lot of tags an info here </item>
    </list>
    I dont know how to exactly create an appropriate control file to my XML. All examples I saw in documentation are similar to this one:
    this is an example control file
    LOAD DATA
    INFILE *
    INTO TABLE test
    APPEND
    XMLTYPE (xmldata)
    FIELDS
    I dont know how to complete this control file. Can anyone help me ?
    thank you!
    Message was edited by:
    pollopolea

    Well I found this working code
    LOAD DATA
    INFILE *
    INTO TABLE test APPEND
    xmltype(xmldata)
    FIELDS
    ext_fname filler char(30),
    xmldata LOBFILE (ext_fname) TERMINATED BY EOF
    BEGINDATA
    mifile.xml
    mifile2.xml
    mifile3.xml
    the main diference I found is that when i use:
    Insert into test values (XMLType(bfilename('XMLDIR', 'swd_uC000025127.xml'),nls_charset_id('AL32UTF8')));
    tag <!DOCTYPE list SYSTEM "myfile.dtd"> is expanded
    (I explain at DTD insertion and errors with long DTD entities
    Now using sql loader the tag is not modified.
    I dont know if is there any difference, between each case. did I lost performance?
    Message was edited by:
    pollopolea

  • Loading huge file with Sql-Loader from Java

    Hi,
    I have a csv file with aprox. 3 and a half million records.
    I load this data with sqlldr from within java like this:
               String command = "sqlldr userid=" + user + "/" + pass
                        + "@" + service + " control='" + ctlFile + "'";
                System.out.println(command);
                if (System.getProperty("os.name").contains("Windows")) {
                    p = Runtime.getRuntime().exec("cmd /C " + command);
                } else {
                    p = Runtime.getRuntime().exec("sh -c " + command);
                }it does what I want to, load the data to a certain table, BUT it takes too much time, Is there a faster way to load data to an oracle db from within java?
    Thanks, any advice is very welcome

    Have your DBA work on this issue - they can monitor and check performance of SQL*Loader
    SQL*Loader performance tips          [Document 28631.1]
    SQL*LOADER SLOW PERFORMANCE          [Document 1026145.6]
    Master Note for SQL*Loader          [Document 1264730.1]
    HTH
    Srini

  • Populating a load-status table from SQL*Loader

    Hello,
    I am using SQL*LDR to load a table and once I'm done with this load I am supposed to populate a status table which will capture the 'SYSDATE', and the total number of rows I loaded in the other table.
    Can anybody help me?
    Thanks

    BTW, the load-status table would take the error-record-count as well as the load-count?
    Sorry missed that earlier!

  • Extract Data from XML and Load into table using SQL*Loader

    Hi All,
    We have a XML file (sample.xml) which contains credit card transaction information. We have a standard SQL*Loader control file which loads the data from a flat file and the control file code is written as position based method. Our requirement is to use this control file as per our requirement(i.e) load the data into the table from our XML file), But we need help in converting the XML to a flat file or Extract the data from the XML tags and pass the information to the control file and in turn it loads the table.
    Your suggestion is highly appreciated.
    Thanks in advance

    Hi,
    First of all go to PSA maintanance ( Where you will see PSA records ).
    Goto list---> Save-> File---> Spreadsheet (Choose Radio Button)
    > Give the proper file name where you want to download and then-----> Generate.
    You will get ur PSA data in Excel Format.
    Thanks
    Mayank

  • Loading VARRAY's with SQL loader, direct path in 9i?

    Isn't it possible to load VARRAY's with SQLloader and direct path in a Oracle 9i database?
    /Magnus Hornstrom
    mailto:[email protected]

    Daniel,
    I appreciate your response alot.
    Now a follow on. You say that SQL*Loader is the fastest way to get data into Oracle Spatial even though the conventional path. How does SQL*Loader do this? Doesn't it use OCI?
    I just can't help but think that coverting my data to SQL*Loader format, and then having it parse it and send it to the database in some form must be slower than me just sending whatever SQL Loader sends to the DB myself using OCI. Am I missing something?
    The SQL Loader documentation seems to suggest that SQL*Loader just turns the input into alot of INSERT stateemnts. If so, can't I just do this?
    My performance with OCI and INSERT statements isn't very good, but I believe I am doing one transaction per insert. Might I be as well off to concentrate on fine tuning my OCI based code using INSERTs?
    I will actually do some time tests myself, but I would appreciate your opinion.
    Once again thanks for the great info you have provided.

  • How to load selected column with sql loader

    Hi all
    I want to load only few columns from a datafile not all columns and i don't know how to do from SQL LDR.
    I know we can use position but the data is not fixed length.
    I'm working with Oracle 11g and Linux OS.
    Here is an example of my data file and table.
    Data file is and the field is separated by | :
    3418483|VOU|20120609090114|555208363|0|2858185502059|1000|0||
    3418484|SR|20120609090124|551261956|0|4146314127759|200000|0||
    SQL> desc TBL1
    Name                                      Null?    Type
    CTYPE                                              VARCHAR2(5)
    BDATE                                              DATE
    PARTNUM                                             VARCHAR2(60)
    SERIALNO                                           NUMBER
    FVALUE                                             NUMBER
    I want to have:
    SQL> select * from TBL1
    CTYPE     BDATE          PARTNUM          SERIALNO          FVALUE
    VOU     09/06/2012     555208363     2858185502059          1000
    SR     09/06/2012     551261956     4146314127759          200000Thank you.

    look at FILLER
    http://www.orafaq.com/wiki/SQL*Loader_FAQ#Can_one_skip_certain_columns_while_loading_data.3F
    --add sample
      num1 FILLER,
      ctype,
      bdate "to_date(:bdate, 'YYYYMMDDHH24MISS')",
      PARTNUM,
      num2 FILLER,
      SERIALNO,
      FVALUE, 
      num3 FILLER
      )Edited by: AlexAnd on Jun 9, 2012 4:29 AM

  • Error loading large field with sql loader for 8i

    I want to load a large field (30K) to a database, where I use "long" datatype for it. But I can't because it loads hexadecimal characters, or it get stuck in a loop and does not load anything. I have tried using clob and long in the database and using char(40000), char, and log varraw in the control file. Any idea or suggestion?
    Thanks a lot.

    Hi,
    from what I see you are running sqllldr in Windows and your database server is on AIX. Is it a remote server or a local network server?
    The ORA-12170 error can be raised for many reasons: firewall issue, database down, listener down, bad sqlnet.ora parm, network trouble, etc
    If your network is slow maybe that is the reason. You may post also SQLNET.ORa configuration and try to reconfigure parameters SQLNET.INBOUND_CONNECT_TIMEOUT, SQLNET.SEND_TIMEOUT, SQLNET.RECV_TIMEOUT in sqlnet.ora to larger values.
    If your problem is not solved, please post your SQLNET.ORA configuration.
    You can check here for details about setting it: Profile Parameters.
    Regards.
    Al

  • Ignoring constraints with SQL*Loader & triggers

    When I load a table with SQL*Loader that has foreign key constraints and a before insert trigger, my foreign key constraints are ignored. The end result is a detail table that contains invalid rows (where some column values do not exist in the master table). If I drop the trigger and just load with SQL*Loader, the foreign key constraints are recognized. Any ideas why this is happening? The trigger simply populates the last updated date and user columns.

    I found this from Asktom very nice. It will help u a lot.
    http://asktom.oracle.com/pls/ask/f?p=4950:9:1988009758486146475::NO:9:F4950_P9_DISPLAYID:8806498660292

  • Problem with loading file with SQL loader

    i am getting a problem with loading a file with SQL loader. The loading is getting
    terminated after around 2000 rows whereas there are around 2700000 rows in the file.
    The file is like
    919879086475,11/17/2004,11/20/2004
    919879698625,11/17/2004,11/17/2004
    919879698628,11/17/2004,11/17/2004
    the control file, i am using is like:-
    load data
    infile 'c:\ran\temp\pps_fc.txt'
              into table bm_05oct06
    fields terminated by ","
    (mobile_no, fcal, frdate )
    I hope, my question is clear. Please help, in solving the doubt.
    regards.

    So which thread is telling the truth?
    Doubt with SQL loader file wih spaces
    Are the fields delimited with spaces or with commas?
    Perhaps they are a mixture of delimiters and that is where the error is coming in?

  • Loading Objects with SQL*Loader

    When loading a column object with SQL*Loader, is it possible to specify a column specific 'TERMINATED BY' clause in the control file?
    I've successfully defined column-level termination characters for regular columns and nested tables, but can't seem to find any way of achieving the same result with column objects.

    When loading a column object with SQL*Loader, is it possible to specify a column specific 'TERMINATED BY' clause in the control file?
    I've successfully defined column-level termination characters for regular columns and nested tables, but can't seem to find any way of achieving the same result with column objects.

Maybe you are looking for

  • Forte Web Enterprise question

    Hello all, I'm experiencing a problem passing variables from JavaScript to the Forte backend. I am using the following function in my html document. <DEFANGED_script language="JavaScript"> <!-- function OpenPage(pAccNo,pSrcCode,pExpType) // this is j

  • My ipod wont play music solely through the ear phones it will only play through the main speaker and quietly through earphones. Is this fixable??

    My ipod wont play music solely through ear phones it will only play through the main speaker and the earphones together. Is this able to be fixed??

  • Urgent SAPScript help

    hi i need to know the steps of changing the form for purchase order.i have chnaged the name of from using spro but when i go to me23n and click on print preview there is no output. Kindly list down the places where i should make the chnages. Any mate

  • [SOLVED] problem with autofs program

    automount is able to start and stop correctly but it does not mount my thumbdrive, how do I solve this? /media does not contain any directories or files /etc/autofs/auto.master # Sample auto.master fi# Sample auto.master file # Format of this file: #

  • How to pass table data to RFC?

    I have scenario below: Z_RFC_SalesOrderEntry_Input |-----> I_T_Area             |--> PNo             |---> Quantity |-----> E_T_Area |-----> Output How to set Table parameter Pno and Qiantity to I_T Area of RFC in web dynpro through coding.....