Sql*loader in form9i

dear all,
how to call sql*loader from form9i?
any one can help me...
thx

You can use the host built in to call a sqlloader located in the web server.
If you want to call it from the web client,use the web_util library where you can find a proc to call executables on the web client.
My oppinion is that is better to upload the import file on the web server(this functioanlity is also on the Forms demos that Oracle has released) and use the sqlloader located there.
This will prevent you getting mixed will all kind of firewall issues.

Similar Messages

  • 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 :-(

  • Sql loader 1: Rejected - Error on table "AP"."AP_SUPPLIER_SITES_INT", ....

    Hello all,
    I am getting error while running below sql loader command...
    load data
    infile *
    into TABLE AP_SUPPLIER_SITES_INT
    REPLACE
    fields terminated by ","
    OPTIONALLY ENCLOSED BY '"'
    VENDOR_INTERFACE_ID expression "to_char('select VENDOR_INTERFACE_ID from AP_SUPPLIERS_INT where CUSTOMER_NUM=:CUSTOMER_NUM')",
    VENDOR_SITE_INTERFACE_ID "to_char(ap_supplier_sites_int_s.NEXTVAL)",
    LAST_UPDATE_DATE "SYSDATE",
    LAST_UPDATED_BY,
    VENDOR_SITE_CODE,
    CREATION_DATE "SYSDATE",
    CREATED_BY,
    PURCHASING_SITE_FLAG,
    PAY_SITE_FLAG,
    ADDRESS_LINE1,
    ADDRESS_LINE2,
    ADDRESS_LINE3,
    CITY,
    STATE,
    ZIP,
    COUNTRY,
    PHONE,
    FAX,
    PAYMENT_METHOD_LOOKUP_CODE,
    TERMS_ID,
    CREATE_DEBIT_MEMO_FLAG,
    HOLD_UNMATCHED_INVOICES_FLAG,
    EMAIL_ADDRESS,
    MATCH_OPTION,
    EXCLUDE_FREIGHT_FROM_DISCOUNT,
    INVOICE_CURRENCY_CODE,
    PAYMENT_CURRENCY_CODE,
    COUNTRY_OF_ORIGIN_CODE,
    FREIGHT_TERMS_LOOKUP_CODE,
    PAY_GROUP_LOOKUP_CODE,
    PAY_DATE_BASIS_LOOKUP_CODE,
    ALWAYS_TAKE_DISC_FLAG,
    ORG_ID)
    begindata
    1005,,SYSDATE,1132,Test MA Site_1,SYSDATE,1132,Y,Y,No#907 62nd Street ,10th Sector,KK Nagar,Chennai,TamilNadu,600078,IN,+91 44 33333333,044 40404040,CHECK,10000,Y,N,[email protected],R,Y,INR,INR,IN,TBD,STANDARD,DISCOUNT,Y,120
    Log file:
    Table "AP"."AP_SUPPLIER_SITES_INT", loaded from every logical record.
    Insert option in effect for this table: REPLACE
    Column Name Position Len Term Encl Datatype
    VENDOR_INTERFACE_ID EXPRESSION
    SQL string for column : "to_char('select VENDOR_INTERFACE_ID from AP_SUPPLIERS_INT where CUSTOMER_NUM=:CUSTOMER_NUM')"
    VENDOR_SITE_INTERFACE_ID FIRST * , O(") CHARACTER
    SQL string for column : "to_char(ap_supplier_sites_int_s.NEXTVAL)"
    LAST_UPDATE_DATE NEXT * , O(") CHARACTER
    SQL string for column : "SYSDATE"
    LAST_UPDATED_BY NEXT * , O(") CHARACTER
    VENDOR_SITE_CODE NEXT * , O(") CHARACTER
    CREATION_DATE NEXT * , O(") CHARACTER
    SQL string for column : "SYSDATE"
    CREATED_BY NEXT * , O(") CHARACTER
    PURCHASING_SITE_FLAG NEXT * , O(") CHARACTER
    PAY_SITE_FLAG NEXT * , O(") CHARACTER
    ADDRESS_LINE1 NEXT * , O(") CHARACTER
    ADDRESS_LINE2 NEXT * , O(") CHARACTER
    ADDRESS_LINE3 NEXT * , O(") CHARACTER
    CITY NEXT * , O(") CHARACTER
    STATE NEXT * , O(") CHARACTER
    ZIP NEXT * , O(") CHARACTER
    COUNTRY NEXT * , O(") CHARACTER
    PHONE NEXT * , O(") CHARACTER
    FAX NEXT * , O(") CHARACTER
    PAYMENT_METHOD_LOOKUP_CODE NEXT * , O(") CHARACTER
    TERMS_ID NEXT * , O(") CHARACTER
    CREATE_DEBIT_MEMO_FLAG NEXT * , O(") CHARACTER
    HOLD_UNMATCHED_INVOICES_FLAG NEXT * , O(") CHARACTER
    EMAIL_ADDRESS NEXT * , O(") CHARACTER
    MATCH_OPTION NEXT * , O(") CHARACTER
    EXCLUDE_FREIGHT_FROM_DISCOUNT NEXT * , O(") CHARACTER
    INVOICE_CURRENCY_CODE NEXT * , O(") CHARACTER
    PAYMENT_CURRENCY_CODE NEXT * , O(") CHARACTER
    COUNTRY_OF_ORIGIN_CODE NEXT * , O(") CHARACTER
    FREIGHT_TERMS_LOOKUP_CODE NEXT * , O(") CHARACTER
    PAY_GROUP_LOOKUP_CODE NEXT * , O(") CHARACTER
    PAY_DATE_BASIS_LOOKUP_CODE NEXT * , O(") CHARACTER
    ALWAYS_TAKE_DISC_FLAG NEXT * , O(") CHARACTER
    ORG_ID NEXT * , O(") CHARACTER
    value used for ROWS parameter changed from 64 to 31
    Record 1: Rejected - Error on table "AP"."AP_SUPPLIER_SITES_INT", column VENDOR_INTERFACE_ID.
    ORA-01722: invalid number
    Please guide me what could be an issue...
    Is there any other way to pass function in sql loader..
    Thanks and Regards
    Muthukumar

    I created function like below...... retrun value as number
    create or replace function VDR_INF_F(V_NUM number)
    return number is
    VDR_INF_id AP_SUPPLIERS_INT.VENDOR_INTERFACE_ID%type;
    begin
    select VENDOR_INTERFACE_ID
    into VDR_INF_id
    from AP_SUPPLIERS_INT
    where CUSTOMER_NUM = V_NUM;
    return VDR_INF_id;
    end;
    And attached that into loader program...
    load data
    infile *
    into TABLE AP_SUPPLIER_SITES_INT
    REPLACE
    fields terminated by ","
    OPTIONALLY ENCLOSED BY '"'
    VENDOR_SITE_INTERFACE_ID "to_char(ap_supplier_sites_int_s.NEXTVAL)",
    LAST_UPDATE_DATE "SYSDATE",
    LAST_UPDATED_BY,
    VENDOR_SITE_CODE,
    CREATION_DATE "SYSDATE",
    CREATED_BY,
    PURCHASING_SITE_FLAG,
    PAY_SITE_FLAG,
    ADDRESS_LINE1,
    ADDRESS_LINE2,
    ADDRESS_LINE3,
    CITY,
    STATE,
    ZIP,
    COUNTRY,
    PHONE,
    FAX,
    PAYMENT_METHOD_LOOKUP_CODE,
    TERMS_ID,
    CREATE_DEBIT_MEMO_FLAG,
    HOLD_UNMATCHED_INVOICES_FLAG,
    EMAIL_ADDRESS,
    MATCH_OPTION,
    EXCLUDE_FREIGHT_FROM_DISCOUNT,
    INVOICE_CURRENCY_CODE,
    PAYMENT_CURRENCY_CODE,
    COUNTRY_OF_ORIGIN_CODE,
    FREIGHT_TERMS_LOOKUP_CODE,
    PAY_GROUP_LOOKUP_CODE,
    PAY_DATE_BASIS_LOOKUP_CODE,
    ALWAYS_TAKE_DISC_FLAG,
    ORG_ID,
    VENDOR_INTERFACE_ID expression "VDR_INF_F(':CUSTOMER_NUM')"
    begindata
    1005,,SYSDATE,1132,Test MA Site_1,SYSDATE,1132,Y,Y,No#907 62nd Street ,10th Sector,KK Nagar,Chennai,TamilNadu,600078,IN,+91 44 33333333,044 40404040,CHECK,10000,Y,N,[email protected],R,Y,INR,INR,IN,TBD,STANDARD,DISCOUNT,Y,120,1005
    1005,,SYSDATE,1132,Test MA Site_2,SYSDATE,1132,Y,Y,No#907 62nd Street ,10th Sector,KK Nagar,Chennai,TamilNadu,600078,IN,+91 44 33333333,044 40404040,CHECK,10000,Y,N,[email protected],R,Y,INR,INR,IN,TBD,STANDARD,DISCOUNT,Y,120,1005
    1005,,SYSDATE,1132,Test MA Site_3,SYSDATE,1132,Y,Y,No#907 62nd Street ,10th Sector,KK Nagar,Chennai,TamilNadu,600078,IN,+91 44 33333333,044 40404040,CHECK,10000,Y,N,[email protected],R,Y,INR,INR,IN,TBD,STANDARD,DISCOUNT,Y,120,1005
    1006,,SYSDATE,1132,Test1 M Site_1,SYSDATE,1132,Y,Y,No#907 62nd Street ,10th Sector,KK Nagar,Chennai,TamilNadu,600078,IN,+91 44 33333333,044 40404040,CHECK,10000,Y,N,[email protected],R,Y,INR,INR,IN,TBD,STANDARD,DISCOUNT,Y,120,1006
    1007,,SYSDATE,1132,Test1 B Site_1,SYSDATE,1132,Y,Y,No#907 62nd Street ,10th Sector,KK Nagar,Chennai,TamilNadu,600078,IN,+91 44 33333333,044 40404040,CHECK,10000,Y,N,[email protected],R,Y,INR,INR,IN,TBD,STANDARD,DISCOUNT,Y,120,1007
    Even now sql loader giving same error..
    like below.....
    able "AP"."AP_SUPPLIER_SITES_INT", loaded from every logical record.
    Insert option in effect for this table: REPLACE
    Column Name Position Len Term Encl Datatype
    VENDOR_SITE_INTERFACE_ID FIRST * , O(") CHARACTER
    SQL string for column : "to_char(ap_supplier_sites_int_s.NEXTVAL)"
    LAST_UPDATE_DATE NEXT * , O(") CHARACTER
    SQL string for column : "SYSDATE"
    LAST_UPDATED_BY NEXT * , O(") CHARACTER
    VENDOR_SITE_CODE NEXT * , O(") CHARACTER
    CREATION_DATE NEXT * , O(") CHARACTER
    SQL string for column : "SYSDATE"
    CREATED_BY NEXT * , O(") CHARACTER
    PURCHASING_SITE_FLAG NEXT * , O(") CHARACTER
    PAY_SITE_FLAG NEXT * , O(") CHARACTER
    ADDRESS_LINE1 NEXT * , O(") CHARACTER
    ADDRESS_LINE2 NEXT * , O(") CHARACTER
    ADDRESS_LINE3 NEXT * , O(") CHARACTER
    CITY NEXT * , O(") CHARACTER
    STATE NEXT * , O(") CHARACTER
    ZIP NEXT * , O(") CHARACTER
    COUNTRY NEXT * , O(") CHARACTER
    PHONE NEXT * , O(") CHARACTER
    FAX NEXT * , O(") CHARACTER
    PAYMENT_METHOD_LOOKUP_CODE NEXT * , O(") CHARACTER
    TERMS_ID NEXT * , O(") CHARACTER
    CREATE_DEBIT_MEMO_FLAG NEXT * , O(") CHARACTER
    HOLD_UNMATCHED_INVOICES_FLAG NEXT * , O(") CHARACTER
    EMAIL_ADDRESS NEXT * , O(") CHARACTER
    MATCH_OPTION NEXT * , O(") CHARACTER
    EXCLUDE_FREIGHT_FROM_DISCOUNT NEXT * , O(") CHARACTER
    INVOICE_CURRENCY_CODE NEXT * , O(") CHARACTER
    PAYMENT_CURRENCY_CODE NEXT * , O(") CHARACTER
    COUNTRY_OF_ORIGIN_CODE NEXT * , O(") CHARACTER
    FREIGHT_TERMS_LOOKUP_CODE NEXT * , O(") CHARACTER
    PAY_GROUP_LOOKUP_CODE NEXT * , O(") CHARACTER
    PAY_DATE_BASIS_LOOKUP_CODE NEXT * , O(") CHARACTER
    ALWAYS_TAKE_DISC_FLAG NEXT * , O(") CHARACTER
    ORG_ID NEXT * , O(") CHARACTER
    VENDOR_INTERFACE_ID EXPRESSION
    SQL string for column : "VDR_INF_F(':CUSTOMER_NUM')"
    value used for ROWS parameter changed from 64 to 31
    Record 1: Rejected - Error on table "AP"."AP_SUPPLIER_SITES_INT", column VENDOR_INTERFACE_ID.
    ORA-01722: invalid number
    Record 2: Rejected - Error on table "AP"."AP_SUPPLIER_SITES_INT", column VENDOR_INTERFACE_ID.
    ORA-01722: invalid number
    Record 3: Rejected - Error on table "AP"."AP_SUPPLIER_SITES_INT", column VENDOR_INTERFACE_ID.
    ORA-01722: invalid number
    Record 4: Rejected - Error on table "AP"."AP_SUPPLIER_SITES_INT", column VENDOR_INTERFACE_ID.
    ORA-01722: invalid number
    Record 5: Rejected - Error on table "AP"."AP_SUPPLIER_SITES_INT", column VENDOR_INTERFACE_ID.
    ORA-01722: invalid number
    Please guide me, how to clear this issue?
    Thanks and Regards,
    Muthu

  • ORA-12899 error from function invoked from SQL*Loader

    I am getting the above error when I call a function from my SQL*Loader script, and I am not seeing what the problem is. As far as I can see, there should be no problem with the field lengths, unless the length of the automatic variable within my function is somehow being set at 30? Here are the details (in the SQL*Loader script, the field of interest is the last one):
    ====
    Error:
    ====
    Record 1: Rejected - Error on table TESTM8.LET_DRIVE_IN_FCLTY, column DIF_CSA_ID.
    ORA-12899: value too large for column "TESTM8"."LET_DRIVE_IN_FCLTY"."DIF_CSA_ID" (actual: 30, maximum: 16)
    =======
    Function:
    =======
    CREATE OR REPLACE FUNCTION find_MCO_id (di_oid_in DECIMAL)
    RETURN CHAR IS mco_id CHAR;
    BEGIN
    SELECT AOL_MCO_LOC_CD INTO mco_id
    FROM CONV_DI_FLCTY
    WHERE DIF_INST_ELMNT_OID = di_oid_in;
    RETURN TRIM(mco_id);
    END;
    ==============
    SQL*Loader Script:
    ==============
    LOAD DATA
    INFILE 'LET_DRIVE_IN_FCLTY.TXT'
    BADFILE 'LOGS\LET_DRIVE_IN_FCLTY_BADDATA.TXT'
    DISCARDFILE 'LOGS\LET_DRIVE_IN_FCLTY_DISCARDDATA.TXT'
    REPLACE
    INTO TABLE TESTM8.LET_DRIVE_IN_FCLTY
    FIELDS TERMINATED BY '~' OPTIONALLY ENCLOSED BY '"'
    DIF_DRIVE_IN_OID DECIMAL EXTERNAL,
    DIF_FCLTY_TYPE_OID DECIMAL EXTERNAL NULLIF DIF_FCLTY_TYPE_OID = 'NULL',
    DIF_INST_ELMNT_OID DECIMAL EXTERNAL,
    DIF_PRI_PERSON_OID DECIMAL EXTERNAL NULLIF DIF_PRI_PERSON_OID = 'NULL',
    DIF_SEC_PERSON_OID DECIMAL EXTERNAL NULLIF DIF_SEC_PERSON_OID = 'NULL',
    DIF_CREATE_TS TIMESTAMP "yyyy-mm-dd-hh24.mi.ss.ff6",
    DIF_LAST_UPDATE_TS TIMESTAMP "yyyy-mm-dd-hh24.mi.ss.ff6",
    DIF_ADP_ID CHAR NULLIF DIF_ADP_ID = 'NULL',
    DIF_CAT_CLAIMS_IND CHAR,
    DIF_CAT_DIF_IND CHAR,
    DIF_DAYLT_SAVE_IND CHAR,
    DIF_OPEN_PT_TM_IND CHAR,
    DIF_CSA_ID CONSTANT "find_MCO_id(:DIF_DRIVE_IN_OID)"
    ============
    Table Definitions:
    ============
    SQL> describe CONV_DI_FLCTY;
    Name Null? Type
    DIF_INST_ELMNT_OID NOT NULL NUMBER(18)
    AOL_MCO_LOC_CD NOT NULL VARCHAR2(3)
    SQL> describe LET_DRIVE_IN_FCLTY;
    Name Null? Type
    DIF_DRIVE_IN_OID NOT NULL NUMBER(18)
    DIF_INST_ELMNT_OID NOT NULL NUMBER(18)
    DIF_FCLTY_TYPE_OID NUMBER(18)
    DIF_ADP_ID VARCHAR2(10)
    DIF_CAT_DIF_IND NOT NULL VARCHAR2(1)
    DIF_CAT_CLAIMS_IND NOT NULL VARCHAR2(1)
    DIF_CSA_ID VARCHAR2(16)
    DIF_DAYLT_SAVE_IND NOT NULL VARCHAR2(1)
    DIF_ORG_ENTY_ID VARCHAR2(16)
    DIF_OPEN_PT_TM_IND NOT NULL VARCHAR2(1)
    DIF_CREATE_TS NOT NULL DATE
    DIF_LAST_UPDATE_TS NOT NULL DATE
    DIF_ITM_FCL_MKT_ID NUMBER(18)
    DIF_PRI_PERSON_OID NUMBER(18)
    DIF_SEC_PERSON_OID NUMBER(18)
    =========================
    Thanks for any help with this one!

    I changed one line of the function to:
    RETURN CHAR IS mco_id VARCHAR2(16);
    But I still get the same error:
    ORA-12899: value too large for column "TESTM8"."LET_DRIVE_IN_FCLTY"."DIF_CSA_ID" (actual: 30, maximum: 16)
    I just am not seeing what is being defined as 30 characters. Any ideas much appreciated!

Maybe you are looking for

  • Read from text file to save into mysql db/text variable

    hi how do I read from a text file and assign the content to a variable. Cause i want to store the text file in a mysql database. any help are greatly appreciated. thanks in advance

  • DiskPart Format : Parameter is incorrect

    I am trying to format a virtual disk & I get an error. I have selected the partition to operate on & ran the format command in a variety of ways [recommended, ntfs, fat, also combined with quick]. I can't for the life of me figure out whats wrong. Is

  • Issue with Iview Analyze

    Hi Experts - I'm just trying to create a simple page with 3 i views which display the PDF documents. I used KM Document I View template and the preview works perfectly. When i add them to a page, sometimes it display them properly and sometimes it th

  • Files with SVG Effect crashes

    Hey, everytime i want to use a SVG Filter Illustrator crashes - and i cant open files with an SVG Effect in it. ty

  • T440p n5321 GPS not working

    Hello, I just upgraded my T440p with an Ericsson N5321gw  mobile broadband card. Unfortunaltely the build in GPS module doesn't deliver any data. The driver is correctly installed (visible in the Device Manager) and the firmware is updated. When I ru