SQL *Loader (Challenging)

Hi all,
I am using sql loader to load data into my database. For one field i want to data split into two line i.e.
abc cde into
abc
cde
What could i add between 'abc cde' to provide my expected result?
I did try 'abc chr(10) cde' but failed
Thank you for your kind attentiion!
Regards,
David

Hi,
But, what is the row terminator and how ur flat file looks like (test.unl). The Column Terminator is OK & in ur case it is ','.
See one of my Control File....and i will try to clarify what i mean:
load data
infile 'BANKDT.dat' "str '<er>'"
into table BANKDT
fields terminated by '<ec>' trailing nullcols
(BDT ,
BLF ,
BW ,
AMT )
Pls. notice that column terminator is <ec> and the row terminator used as <er>. and my flat file i.e. BANKDT.DAT looks like
....<ec>....<ec>...<ec>....<er>....<ec>.......<ec>....<ec>...<ec>....<er>
Where ... represent the field value.
This way i hope it must be clear to you and you able to get it throuhg.
Regards,
Kamesh Rastogi

Similar Messages

  • SQL Loader :variant number of field and delimeiter .

    I want to load data into table using SQL LOADER.
    Challenge I am facing is fields are separated either by ',' or '.'
    Eg:x0,y0,z0,a0.b0.c0.d0,p1,q1,r1
    x1,y1,z1,a1.b1.c1,p1,q1
    ie, the whole field, which contain '.' can be a join of any numebr of fields of maximum 30
    ie the field a0.b0.c0.d0 => would be any number of fields separated by '.'
    How to load these details into a table
    Thanks in advance,
    Arya Sreedhar.

    Wouldn't it be better to process a decent file (with a single delimiter) instead of trying to fix the layout of an undecent file?

  • Passing file name dynamically to sql loader ctl file

    Hi,
    I am new to scripting and I have a complex requirement involving writing a script.
    Requierment:
    I need to upload a CSV file from a FTP server into oracle table using SQL Loader. The file name resembles like APF0912312359.csv represents 31-DEC-2009 23:59 and there will be multiple files in same day indicated by differnt timestamp as its filename. Once I load a file using SQL loader, I need to move the file to another directory for archival.
    Since the sql loader ctl file has a fixed file name, I would like to know how I can pass the file name dynamically to ctl file to load a new file every time it runs.
    Any help is greatly appreciated..
    Bye
    Sudheer
    Edited by: user2138419 on Oct 28, 2009 4:08 PM

    I agree with Pradeep in regards to declaring the file names on the command line. However, I do have a concern regarding presenting the password on the command line as any user that can issue a ps (assuming Unix ~= Linux here) would be able to read it while the sqlldr command is running.
    Unfortunately, you may not always have the option of declaring the files on the command line. I was recently challenged with this in a Windows 2003 Server environment running SQL*Loader: Release 10.2.0.1.0. In this environment I found that I am able to set a variable file name in a calling batch file and use that value in the control file successfully. Just to demonstrate the approach:
    Batch file:
    set IN_FILE=’c:\inbound\load_me.txt’
    sqlldr user/pswd@db PARFILE=’c:\parameters.txt’
    Parameter file:
    errors=500000
    rows=50000
    control=%CTL_FILE%
    bad=%BAD_FILE%
    discard=%DSC_FILE%
    log=%LOG_FILE%
    Control file:
    LOAD DATA
    INFILE ‘%IN_FILE%’
    INSERT
    INTO TABLE table_to_be_loaded
    I’m really interested to see if this would work on Unix.
    -Luke

  • How to load a default value in to a column when using sql loader

    Im trying to load from a flat file using sql loader.
    for 1 column i need to update using a default value
    how to go about this?

    Hi!
    try this code --
    LOAD DATA
       INFILE 'sample.dat'
       REPLACE
       INTO TABLE emp
       empno   POSITION(01:04) INTEGER EXTERNAL NULLIF empno=BLANKS,
       ename   POSITION(06:15)  CHAR,
       job         POSITION(17:25)  CHAR,
       mgr       POSITION(27:30)  INTEGER EXTERNAL NULLIF mgr=BLANKS,
       sal        POSITION(32:39)  DECIMAL EXTERNAL NULLIF sal=BLANKS,
       comm   POSITION(41:48)  DECIMAL EXTERNAL DEFAULTIF comm = 100,
       deptno  POSITION(50:51)  INTEGER EXTERNAL NULLIF deptno=BLANKS,
       hiredate POSITION(52:62) CONSTANT SYSDATE
      )-hope this will solve ur purpose.
    Regards.
    Satyaki De.

  • How can we tell if SQL*Loader is working on a TABLE?

    We have a process that requires comparing batches with LDAP information. Instead of using an LDAP lookup tool, we get a nightly directory file, and import the two COLUMNs we want via SQL*Loader (REPLACE) into an IOT. Out of three cases, two just check the first COLUMN, and the third needs the second COLUMN as well.
    We did not think of using External TABLEs, because we cannot store files on the DB server itself.
    The question arises, what to do while the file is being imported. The file is just under 300M, so it takes a minute or so to replace all the data. We found SQL*Loader waits until a transaction is finished before starting, but a query against the TABLE only waits while it is actually importing the data. At the beginning of SQL*Loader's process, however, a query against the TABLE returns no rows.
    The solution we are trying right now is, to have the process that starts SQL*Loader flip a flag in another TABLE denoting that it is unavailable. When it is done, it flips it back, and notes the date. Then, the process that queries the information, exits if the flag is currently 'N'.
    The problem, is, what if SQL*Loader starts inbetween the check of the flag, and the query against the TABLE. How do we guarantee that it is still not being imported.
    I can think of three solutions:
    1) LOCK the ldap information TABLE before checking the flag.
    2) LOCK the record that the process starting SQL*Loader flips.
    3) Add a clause to the query against the TABLE checks that there are records in the TABLE (AND EXISTS(SELECT * FROM ldap_information).
    The problem with 3) is that the process has already tagged the batches (via a COLUMN). It could, technically reset them afterwards, but that seems a bit backwards.

    Just out of curiosity, are you aware that Oracle supplies a DBMS_LDAP package for pulling information from LDAP sources? It would obviously be relatively easy to have a single transaction that deletes the existing data, loads the new data via DBMS_LDAP, and commits, which would get around the problem you're having with SQL*Loader truncating the table.
    You could also have SQL*Loader load the data into a staging table and then have a second process either MERGE the changes from the staging table into the real table (again in a transactionally consistent manner) or just delete and insert the data.
    Justin

  • Loading two tables at same time with SQL Loader

    I have two tables I would like to populate from a file C:\my_data_file.txt.
    Many of the columns I am loading into both tables but there are a handful of columns I do not want. The first column I do not want for either table. My problem is how I can direct SQL Loader to go back to the first column and skip over it. I had tried using POSITION(1) and FILLER for the first column while loading the second table but I got THE following error message:
    SQL*Loader-350: Syntax error at line 65
    Expecting "," or ")" found keyword Filler
    col_a Poistion(1) FILLER INTEGER EXTERNALMy control file looks like the following:
    LOAD DATA
    INFILE 'C:\my_data_file.txt'
    BADFILE 'C:\my_data_file.txt'
    DISCARDFILE 'C:\my_data_file.txt'
    TRUNCATE INTO TABLE table_one
    WHEN (specific conditions)
    FIELDS TERMINATED BY ' '
    TRAILING NULLCOLS
    col_a FILLER INTEGER EXTERNAL,
    col_b INTEGER EXTERNAL,
    col_g FILLER CHAR,
    col_h CHAR,
    col_date DATE "yyyy-mm-dd"
    INTO TABLE table_two
    WHEN (specific conditions)
    FIELDS TERMINATED BY ' '
    TRAILING NULLCOLS
    col_a POSITION(1) FILLER INTEGER EXTERNAL,
    col_b INTEGER EXTERNAL,
    col_g FILLER CHAR,
    col_h CHAR,
    col_date DATE "yyyy-mm-dd"
    )

    Try adapting this for your scenario.
    tables for the test
    create table test1 ( fld1 varchar2(20), fld2 integer, fld3 varchar2(20) );
    create table test2 ( fld1 varchar2(20), fld2 integer, fld3 varchar2(20) );
    control file
    LOAD DATA
    INFILE "test.txt"
    INTO TABLE user.test1 TRUNCATE
    WHEN RECID = '1'
    FIELDS TERMINATED BY ' '
    recid filler integer external,
    fld1 char,
    fld2 integer external,
    fld3 char
    INTO TABLE user.test2 TRUNCATE
    WHEN RECID <> '1'
    FIELDS TERMINATED BY ' '
    recid filler position(1) integer external,
    fld1 char,
    fld2 integer external,
    fld3 char
    data for loading [text.txt]
    1 AAAAA 11111 IIIII
    2 BBBBB 22222 JJJJJ
    1 CCCCC 33333 KKKKK
    2 DDDDD 44444 LLLLL
    1 EEEEE 55555 MMMMM
    2 FFFFF 66666 NNNNN
    1 GGGGG 77777 OOOOO
    2 HHHHH 88888 PPPPP
    HTH
    RK

  • Creating SQL-Loader script for more than one table at a time

    Hi,
    I am using OMWB 2.0.2.0.0 with Oracle 8.1.7 and Sybase 11.9.
    It looks like I can create SQL-Loader scripts for all the tables
    or for one table at a time. If I want to create SQL-Loader
    scripts for 5-6 tables, I have to either create script for all
    the tables and then delete the unwanted tables or create the
    scripts for one table at a time and then merge them.
    Is there a simple way to create migration scripts for more than
    one but not all tables at a time?
    Thanks,
    Prashant Rane

    No there is no multi-select for creating SQL-Loader scripts.
    You can either create them separately or create them all and
    then discard the one you do not need.

  • SQL Loader (Oracle 8.1.5 on Suse 6.3) Internal Error

    Hi all,
    I try to insert data with SQL Loader on Linux (Suse 6.3) and get the following message:
    SQL*Loader-704: Internal error: ulmtsyn: OCIStmtExecute (tabhp) [-1073747572]
    ORA-00942: table or view does not exist
    The control file and data file did work on another platform.
    Please help me!
    Thanks,
    Thies Mauker

    Lee Bennett (guest) wrote:
    :Hi
    :I have successfully installed Oracle 8.1.5 Enterprise edition
    on
    :Suse 6.2 and applied the 8.1.5.0.1 patch set,
    NO!
    SuSe 6.2 have a patch file for Oracle made from their developers.
    Never use Oracle 8.1.5.0.1 patch file that doesn't work because
    us bugged.
    Use SuSe 6.2 Oracle patch set.
    (don't remember the web page where you can download it but a
    search with word "oracle" from SuSe homepage will lead you to
    it)
    -Stefano
    null

  • Decode Not working in sql loader

    I had a requirement of loading flatfile into staging table using SQL Loader, One of the columns in the the Flat file is having values FALSE or TRUE and my requirement is that I load 0 for FALSE and 1 for TRUE which can be achieved by simple DECODE function...I did use decode and tried to load several times but did not work. What might be the problem
    LOAD DATA
    INFILE 'sql_4ODS.txt'
    BADFILE 'SQL_4ODS.badtxt'
    APPEND
    INTO TABLE members
    FIELDS TERMINATED BY "|"
    ( Person_ID,
    FNAME,
    LNAME,
    Contact,
    status "decode(:status, 'TRUE', '1','FALSE','0')"
    I did try putting a trim as well as SUBSTR but did not work....the cloumn just doent get any values in the output (just null or say free space)
    Any help would be great.....

    Hello user8937215.
    Please provide a create table statement and a sample of data file contents. I would expect DECODE or CASE to work based on the information provided.
    Cheers,
    Luke
    Please mark the answer as helpful or answered if it is so. If not, provide additional details.
    Always try to provide create table and insert table statements to help the forum members help you better.

  • SQL*Loader and DECODE function

    Hi All,
    I am loading data from data files into oracle tables and while loading the data using SQL*Loader, the following requirement needs to be fulfilled.
    1) If OQPR < 300, RB = $ 0-299, SC = "SC1"
    2) If 300 < OQPR < 1200, RB = $ 300-1199, SC = "SC2"
    3) If 1200 < OQPR < 3000, RB = $ 1200-2999, SC = "SC3"
    4) If OQPR > 3000 USD, RB = > $3000, SC = "SC4"
    Here OPQR is a field in the data file.
    Can anyone suggest how do we handle this using DECODE function? Triggers and PL/SQL functions are not to be used.
    TIA.
    Regards,
    Ravi.

    The following expression gives you different values for your different intervals and boundaries :
    SIGN(:OQPR - 300) + SIGN(:OQPR - 1200) + SIGN(:OQPR - 3000)

  • SQL Loader Inserts chr(13) and chr(10) in the first column of every row.

    Hi,
    I have exported a data in a pipe delimited file using TOAD in one database. Now I want to load the data in my local database using SQL Loader. However every time I try to load the data a double quote followed by a new line is entered for the first column of each row. Unfortunately the delimited file is very big and hence can't be posted here. However I tried the same with a customized table and its data and found the same problem. Below are the table structures and control file that I used.
    create table test_sql
    a varchar2(30),
    b date
    insert into test_sql values('51146263',sysdate-3);
    insert into test_sql values('51146261,sysdate-1);
    EXPORTED PIPE DELIMITED FILE_
    A|B|!##!
    51146261|04/14/13 4:55:18 PM|!##!
    51146263|04/12/13 4:55:32 PM|!##!
    create table test_sql1 as select * from test_sql where 1=2;
    CONTROL FILE_
    OPTIONS(SKIP=1)
    LOAD DATA
    INFILE 'C:\Users\Prithwish\Desktop\Test.txt' "str '!##!'"
    PRESERVE BLANKS
    INTO TABLE TEST_SQL1
    FIELDS TERMINATED BY '|' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    A CHAR(2000),
    B DATE "MM/DD/YYYY HH12:MI:SS AM"
    select * from TEST_SQL1;
    After this when I paste it in notepad I get the following result
    A B
    51146261"     14-APR-0013 16:55:18
    51146263"     12-APR-0013 16:55:32.
    I have no idea how the quotes or the newline appear. Is this a Toad bug? Any help would be greatly appreciated. Really urgent.
    Thanks in advance
    Regards

    Hi Harry,
    I actually thought that the str !##! was causing the problem. Actually my original export has some new lines in some specific columns so I can't keep the new line as my line terminator and hence I kept the !##! as my terminator.
    When I put the same data in a notepad and load it there is no problem at all. For e.g I just typed the following in a notepad and the data loaded just fine.
    A|B|!##!
    51146261|01-01-01 10:10:10 AM|!##!
    51146263|01-01-01 11:11:11 AM|!##!
    Its just when I load the exported file there the problem arises though I have verified the file using UNIX as well using octal dump and found no hidden characters.
    Regards,
    Prithwish

  • Load XML File into temporary tables using sql loader

    Hi All,
    I have an XML file as below. I need to insert the contents into a temporary staging table using sql loader. Please advice how I need to do that.
    For example Portfolios should go into a seperate table, and all the tags inside it should be populated in the columns of the table.
    Family should go into a seperate table and all the tags inside it should be populated in the columns of the table.
    Similarly offer, Products etc.
    - <ABSProductCatalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    - <ProductSalesHierachy>
    - <Portfolios>
    - <Portfolio productCode="P1">
      <Attribute name="CatalogProductName" value="Access" />
      <Attribute name="Status" value="Active" />
      </Portfolio>
    - <Portfolio productCode="P2">
      <Attribute name="CatalogProductName" value="Data" />
      <Attribute name="Status" value="Active" />
      </Portfolio>
    - <Portfolio productCode="P3">
      <Attribute name="CatalogProductName" value="Voice" />
      <Attribute name="Status" value="Active" />
      </Portfolio>
    - <Portfolio productCode="P4">
      <Attribute name="CatalogProductName" value="Wireless" />
      <Attribute name="Status" value="Active" />
      </Portfolio>
      </Portfolios>
    - <Families>
    - <Family productCode="F1">
      <Attribute name="CatalogProductName" value="Internet Access Services" />
      <Attribute name="Status" value="Active" />
    - <ParentHierarchy>
      <Item productCode="P1" modelType="Portfolio" />
      </ParentHierarchy>
      </Family>
    - <Family productCode="F2">
      <Attribute name="CatalogProductName" value="Local Access Services" />
      <Attribute name="Status" value="Active" />
    - <ParentHierarchy>
      <Item productCode="P2" modelType="Portfolio" />
      </ParentHierarchy>
      </Family>
      </Families>
    - <SubFamilies>
    - <SubFamily productCode="SF1">
      <Attribute name="CatalogProductName" value="Business Internet service" />
      <Attribute name="Status" value="Active" />
    - <ParentHierarchy>
      <Item productCode="F1" modelType="Family" />
      </ParentHierarchy>
      </SubFamily>
      </SubFamilies>
    - <ProductRefs>
    - <ProductRef productCode="WSP1" modelType="Wireline Sales Product">
      <ActiveFlag>Y</ActiveFlag>
    - <ProductHierarchy>
      <SalesHierarchy family="F1" subFamily="SF1" portfolio="P1" primary="Y" />
      <SalesHierarchy family="F2" portfolio="P2" primary="N" />
      <FinancialHierarchy quotaBucket="Voice" strategicProdCategory="Local Voice" />
      </ProductHierarchy>
      </ProductRef>
    - <ProductRef productCode="MSP2" modelType="Handset">
      <ActiveFlag>Y</ActiveFlag>
    - <ProductHierarchy>
      <SalesHierarchy portfolio="P4" primary="Y" />
      </ProductHierarchy>
      </ProductRef>
      </ProductRefs>
      </ProductSalesHierachy>
    - <Offers>
    - <Offer productCode="ABN">
      <OfferName>ABN</OfferName>
      <OfferDescription>ABN Description</OfferDescription>
    - <Segments>
      <Segment>SCG</Segment>
      <Segment>PCG</Segment>
      </Segments>
      <OfferUpdateDate>2009-11-20</OfferUpdateDate>
      <ActiveFlag>Y</ActiveFlag>
      </Offer>
    - <Offer productCode="OneNet">
      <OfferName>OneNet</OfferName>
      <OfferDescription>OneNet Description</OfferDescription>
    - <Segments>
      <Segment>SCG</Segment>
      <Segment>PCG</Segment>
      <Segment>PCG2</Segment>
      </Segments>
      <OfferUpdateDate>2009-11-20</OfferUpdateDate>
      <ActiveFlag>Y</ActiveFlag>
      </Offer>
      </Offers>
    - <Products>
    - <Product productCode="WSP1" modelType="Wireline Sales Product">
      <ProductName>AT&T High Speed Internet</ProductName>
      <ProductDescription>High Speed Internet</ProductDescription>
      <LegacyCoProdIndicator>SBC</LegacyCoProdIndicator>
      <RevenueCBLCode>1234B</RevenueCBLCode>
      <VolumeCBLCode>4567A</VolumeCBLCode>
      <SAARTServiceIDCode>S1234</SAARTServiceIDCode>
      <MarginPercentRequired>Y</MarginPercentRequired>
      <PercentIntl>%234</PercentIntl>
      <UOM>Each</UOM>
      <PriceType>OneTime</PriceType>
      <ProductStatus>Active</ProductStatus>
      <Compensable>Y</Compensable>
      <Jurisdiction>Everywhere</Jurisdiction>
      <ActiveFlag>Y</ActiveFlag>
    - <Availabilities>
      <Availability>SE</Availability>
      <Availability>E</Availability>
      </Availabilities>
    - <Segments>
      <Segment>SCG</Segment>
      <Segment>PCG</Segment>
      </Segments>
      <VDIndicator>Voice</VDIndicator>
      <PSOCCode>PSOC 1</PSOCCode>
      <USBilled>Y</USBilled>
      <MOWBilled>N</MOWBilled>
      <ProductStartDate>2009-11-20</ProductStartDate>
      <ProductUpdateDate>2009-11-20</ProductUpdateDate>
      <ProductEndDate>2010-11-20</ProductEndDate>
    - <AliasNames>
      <AliasName>AT&T HSI</AliasName>
      <AliasName>AT&T Fast Internet</AliasName>
      </AliasNames>
    - <OfferTypes>
      <OfferType productCode="ABN" endDate="2009-11-20" />
      <OfferType productCode="OneNet" />
      </OfferTypes>
    - <DynamicAttributes>
    - <DynamicAttribute dataType="String" defaultValue="2.5 Mbps" name="Speed">
      <AttrValue>1.5 Mbps</AttrValue>
      <AttrValue>2.5 Mbps</AttrValue>
      <AttrValue>3.5 Mbps</AttrValue>
      </DynamicAttribute>
    - <DynamicAttribute dataType="String" name="TransportType">
      <AttrValue>T1</AttrValue>
      </DynamicAttribute>
      </DynamicAttributes>
      </Product>
    - <Product productCode="MSP2" modelType="Handset">
      <ProductName>Blackberry Bold</ProductName>
      <ProductDescription>Blackberry Bold Phone</ProductDescription>
      <LegacyCoProdIndicator />
      <RevenueCBLCode />
      <VolumeCBLCode />
      <SAARTServiceIDCode />
      <MarginPercentRequired />
      <PercentIntl />
      <UOM>Each</UOM>
      <PriceType />
      <ProductStatus>Active</ProductStatus>
      <Compensable />
      <Jurisdiction />
      <ActiveFlag>Y</ActiveFlag>
    - <Availabilities>
      <Availability />
      </Availabilities>
    - <Segments>
      <Segment>SCG</Segment>
      <Segment>PCG</Segment>
      </Segments>
      <VDIndicator>Voice</VDIndicator>
      <PSOCCode />
      <USBilled />
      <MOWBilled />
      <ProductStartDate>2009-11-20</ProductStartDate>
      <ProductUpdateDate>2009-11-20</ProductUpdateDate>
    - <AliasNames>
      <AliasName />
      </AliasNames>
    - <OfferTypes>
      <OfferType productCode="ABN" />
      </OfferTypes>
    - <DynamicAttributes>
    - <DynamicAttribute dataType="String" name="StlmntContractType">
      <AttrValue />
      </DynamicAttribute>
    - <DynamicAttribute dataType="String" name="BMG 2 year price">
      <AttrValue>20</AttrValue>
      </DynamicAttribute>
    - <DynamicAttribute dataType="String" name="MSRP">
      <AttrValue>40</AttrValue>
      </DynamicAttribute>
    - <DynamicAttribute dataType="String" name="BMGAvailableType">
      <AttrValue />
      </DynamicAttribute>
    - <DynamicAttribute dataType="String" name="ProductId">
      <AttrValue>123456</AttrValue>
      </DynamicAttribute>
    - <DynamicAttribute dataType="String" name="modelSource">
      <AttrValue>product</AttrValue>
      </DynamicAttribute>
      </DynamicAttributes>
      </Product>
      </Products>
      <CatalogChanged>Y</CatalogChanged>
      </ABSProductCatalog>

    Two options that come to mind. Others exist.
    #1 - {thread:id=474031}, which is basically storing the XML in an Object Relational structure for parsing
    #2 - Dump the XML into either an XMLType based table or column and use SQL (with XMLTable) to create a view that parses the data. This would be the same as the view shown in the above post.
    Don't use sql*loader to parse the XML. I was trying to find a post from mdrake about that but couldn't. In short, sql*loader was not build as an XML parser so don't try to use it that way.

  • How to do it with SQL Loader

    All,
    I have two tables HEADER_TABLE and LINE_TABLE. Each header record can have multiple line records. I have to load data from a flat file to these tables.Flat file can have two types of records. H-Header, L-Line. It looks as follows.. Each H record can have multiple corresponding L records
    H..........
    L.......
    L......
    L......
    H.........
    L.......
    L......
    L......
    I have HEADER_ID column in HEADER_TABLE and HEADER_ID, LINE_ID columns in the LINE_TABLE.
    While loading data using SQL Loader, I need to generate HEADER_ID and LINE_ID values as follows and load them.
    H..........<HEADER_ID = 1>
    L....... <HEADER_ID = 1><LINE_ID = 1>
    L...... <HEADER_ID = 1><LINE_ID = 2>
    L...... <HEADER_ID = 1><LINE_ID = 3>
    H......... <HEADER_ID = 2>
    L....... <HEADER_ID = 2><LINE_ID = 4>
    L...... <HEADER_ID = 2><LINE_ID = 5>
    L...... <HEADER_ID = 2><LINE_ID = 6>
    Is it possible to do this with SQL LODER?
    I tried to do this with sequences. But it loaded the tables as follows.
    H..........<HEADER_ID = 1>
    L....... <HEADER_ID = 1><LINE_ID = 1>
    L...... <HEADER_ID = 1><LINE_ID = 2>
    L...... <HEADER_ID = 1><LINE_ID = 3>
    H......... <HEADER_ID = 2>
    L....... <HEADER_ID = 1><LINE_ID = 4>
    L...... <HEADER_ID = 1><LINE_ID = 5>
    L...... <HEADER_ID = 1><LINE_ID = 6>
    Thanks
    Ketha

    Morgan,
    Examples given in the link are quite generic and I have tried them. But my requirement is focused on generating header_id and line_id values as i have described. It seems that SQLLDR scans all records for a particular WHEN clause and insert them into the specified table. I think that if SQLLDR is made to read recod in the data file sequentially, this can be done.
    ANy idea of how to make SQLLDR read the records from the file sequentially?
    Thanks
    Ketha

  • Invokin SQL*Loader from a stored procedure

    I try to invoke SQL*LOADER from within a database package by using external C procedure (the procedure calls the system() C function) but the loader generates the following error in its log file :
    SQL*Loader -523: error -2 writing to file (STDERR)
    and no data is uploaded.
    I have tried to use system() from within database procedures to execute OS commands and it works. Does anyone know what is the problem with using system() to execute "sqlldr <parameters>"? Is there some other way to call the loader from within a stored PL/SQL procedure?
    Thank you very much for your help.
    Aneta Valova
    null

    Hi
    What is your task and why you are trying to invoke SQL*Loader from strorage procedure or package? Maybe the redirecting of stderr will resolve your problem but thik is it the best way to do your job.
    I am not sure, that invoking other executables from Oracle instance is good idea.
    Regards
    null

  • Problem with SQL*Loader and different date formats in the same file

    DB: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    System: AIX 5.3.0.0
    Hello,
    I'm using SQL*Loader to import semi-colon separated values into a table. The files are delivered to us by a data provider who concatenates data from different sources and this results in us having different date formats within the same file. For example:
    ...;2010-12-31;22/11/1932;...
    I load this data using the following lines in the control file:
    EXECUTIONDATE1     TIMESTAMP     NULLIF EXECUTIONDATE1=BLANKS     "TO_DATE(:EXECUTIONDATE1, 'YYYY-MM-DD')",
    DELDOB          TIMESTAMP     NULLIF DELDOB=BLANKS          "TO_DATE(:DELDOB, 'DD/MM/YYYY')",
    The relevant NLS parameters:
    NLS_LANGUAGE=FRENCH
    NLS_DATE_FORMAT=DD/MM/RR
    NLS_DATE_LANGUAGE=FRENCH
    If I load this file as is the values loaded into the table are 31 dec 2010 and 22 nov *2032*, aven though the years are on 4 digits. If I change the NLS_DATE_FORMAT to DD/MM/YYYY then the second date value will be loaded correctly, but the first value will be loaded as 31 dec *2020* !!
    How can I get both date values to load correctly?
    Thanks!
    Sylvain

    This is very strange, after running a few tests I realized that if the year is 19XX then it will get loaded as 2019, and if it is 20XX then it will be 2020. I'm guessing it may have something to do with certain env variables that aren't set up properly because I'm fairly sure my SQL*Loader control file is correct... I'll run more tests :-(

Maybe you are looking for

  • Contact changes address to wrong location every time

    ok so input the address "655 W. Irving Park Rd. Chicago, IL" to maps. the location is accurate.click the arrow and add to existing contact add it to a contact the the contact is opened I click on the address to show it on the maps the same address is

  • Struts action forward is NULL

    Hi, I have a Index jsp page. Ihave defined IndexAction as action class for this. I have defined it as <welcome-file> in web.xml. Also I have action tab in struts-config file: <action path="/index" type="com.cec.cll.webclient.logical.clr.actionclass.I

  • How to call OWB Process Flow from APEX?

    Hello. I was wondering if there is a way that I can have a OWB process flow kick off from a button in APEX? I know you can have APEX perform PL/SQL upon being clicked, so I am wondering if there is a way that I can do the same for a process flow? We

  • Printing gives wrong characters

    When I print a web-page, a lot of garbled characters appear on the print. This happens with different printers and also when I print to a pdf. Also, the printing header is completely garbled. In IE these pages print normally.

  • Ovi Player crashes

    I have recently downloaded the latest version of Ovi Player but it is crashing all the time, this has never happened with the previous versions, is this happening to any one else? Best regards, Albert de Castro @ MaisonChaplin.blogspot.com