SQL Loader Control file - which represent decimal numbers

Hello

I use the version of database Oracle 10.2.0. I will receive a data file delimited pipe I need to load into the table specified below. Can you please suggest me how to represent the last column ERROR_PERCENT in the control file, which is number (3.2) in the table? I tried DECIMAL (3,2), EXTERNAL (3,2) DECIMAL against it and I get errors wasgetting. Help, please.



CREATE TABLE TRACK_ERRORS
(
ACCOUNT_ID NUMBER (7).
DATESTAMP TIMESTAMP (6).
SPECIFIC_RISK NUMBER (3).
STOCK_RISK NUMBER (3).
ERROR_PERCENT NUMBER (3.2)
)



OPTIONS (SKIP = 1)
DOWNLOAD THE DATA
INFILE 'C:\Sqlldr\Input\Track_Errors.dat '.
BADFILE "C:\Sqlldr\Track_Errors.bad."
DISCARDFILE 'C:\Sqlldr\Track_Errors.dis '.
ADD
IN THE TABLE "TRACK_ERRORS.
fields ended by ' |' SURROUNDED OF POSSIBLY "" "
TRAILING NULLCOLS
(Account_Id EXTERNAL INTEGER (7)
, datestamp 'Rtrim (to_date (:datestamp,'YYYY/MM/DD')).
Specific_Risk INTEGER EXTERNAL (3)
Stock_Risk INTEGER EXTERNAL (3)
ERROR_PERCENT
)


Kind regards
Naveen

Naveen Kumar C wrote:
I tried with decimal external. It does not work. The following is the log file

SQL * Loader: Release 10.2.0.1.0 - Production on Thu Feb 25 10:11:42 2010

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Control file: track_errors.ctl
Data file: C:\Sqlldr\Input\Track_Errors.dat
Bad leadership: C:\Sqlldr\Track_Errors.bad
Delete the file: C:\Sqlldr\Track_Errors.dis
(Allow all releases)

Number of loading: ALL
Number of jump: 1
Authorized errors: 50
Link table: 64 lines, maximum of 256000 bytes
Continuation of the debate: none is specified
Path used: classics

Table "TRACK_ERRORS', loaded from every logical record.
Insert the option in effect for this table: APPEND
TRAILING NULLCOLS option in effect

Column Position Len term Encl. Datatype name
------------------------------ ---------- ----- ---- ---- ---------------------
FIRST ARGUMENT ACCOUNT_ID 7 | O ("") CHARACTER
DATESTAMP NEXT * | O ("") CHARACTER
The SQL string for the column: "Rtrim (to_date (:datestamp,'YYYY/MM/DD')).
SPECIFIC_RISK 3 | O ("") CHARACTER
STOCK_RISK 3 | O ("") CHARACTER
ERROR_PERCENT NEXT * | O ("") CHARACTER

Sheet 1: Rejected - error on the table 'TRACK_ERRORS", the ERROR_PERCENT column.
ORA-01438: value larger than the precision specified for the column

Sheet 2: Rejected - error on the table 'TRACK_ERRORS", the ERROR_PERCENT column.
ORA-01438: value larger than the precision specified for the column

Sheet 3: Rejected - error on the table 'TRACK_ERRORS", the ERROR_PERCENT column.
ORA-01438: value larger than the precision specified for the column

Table "TRACK_ERRORS":
0 rows successfully loaded.
3 rows not loaded due to data errors.
0 rows not loading because all WHEN clauses were failed.
0 rows not populated because all fields are null.

The space allocated to bind table: 34432 byte (64 lines)
Bytes of read buffer: 256000

Ignored logical records total: 1
Total logical records read: 3
Total rejected logical records: 3
Total logical records ignored: 0

Run started the Thu Feb 25 10:11:42 2010
Run finished the game Feb 25 10:11:55 2010

Time was: 00:00:13.99
Time processor was: 00:00:00.14

It does not work because of the data and not + external comma +.
These mistakes ORA-set out clearly that your data values are larger than the eligible accuracy.

isotope

Tags: Database

Similar Questions

  • Conditions in SQL Loader Control file

    Hello

    I am trying to find a way to set up a sql loader control file that will have the data to a CSV (as shown below):

    ACCOUNT DESCRIPTION 9-Apr 9-May 9-June 9 - Jul 9-Aug 9-Sep
    3573000 H - 75 68 75 75 75 30 CLRICL
    3123000 10 10 6 12 10 7 HRS-OTHER
    3151000 HRS - BISHOP 150 143 150 143 120 143
    3153000 HRS - BISHOP 22 22 14 29 22 22
    3571000 H-TEACHER 135 143 150 218 143 143

    and import it into an Oracle table as below:

    ACCOUNT YR_MNTH TOTAL DESCRIPTION
    3573000 h-CLRICL April 9, 70
    3123000 HRS-OTHER 9-Apr 5
    3151000 HRS - MGR 9 - APR 129
    HRS - MGR 3153000 9-April 20
    3571000 HRS - TEACHER 9 - APR 145
    3573000 h-CLRICL 9 may 73
    3123000 HRS - OTHER 9 - May 12
    3151000 HRS - MGR 9 - may 135
    HRS - MGR 3153000 9-10 may
    3571000 HRS - TEACHER 9 - may 150
    3573000 h-CLRICL June 9, 75
    3123000 HRS-OTHER 9 - Jun 10
    3151000 HRS - 9 - Jun 150 MGR
    HRS - MGR 3153000 9-June 22
    3571000 HRS-TEACHER 9 - Jun 135
    3573000 h-CLRICL July 9, 68
    3123000 HRS - OTHER 9-Jul 10
    3151000 HRS - MGR 9 - Jul 143
    HRS - MGR 3153000 9 - Jul 22
    3571000 HRS - TEACHER 9 - Jul 143
    3573000 h-CLRICL August 9, 75
    3123000 HRS - OTHER 9-August 6
    3151000 HRS - MGR 9 - August 150
    HRS - MGR 3153000 9-August 14
    3571000 HRS - TEACHER 9 - August 150
    3573000 h-CLRICL 9 - Sep 75
    3123000 9 HRS-OTHER-Sep 12
    HRS - MGR 3151000 9-Sep 143
    9 HRS - MGR 3153000 - Sept. 29
    3571000 HRS-TEACHER 9 - Sep 218

    Has anyone done anything like this? Any light anyone can throw is greatly appreciated.

    Thank you.

    Edited by: user11293056 January 6, 2010 09:19

    Hello

    I think you'll be better off using external pointing to csv data, and then by running the query on the external table to insert rows in the target table table.

    Concerning

  • Parameters / Variables in SQL Loader Control File

    Here's my problem, I created the SQL Loader control file (ctl) to load a file of employees. This loading program is stored in the Oracle Applications. I want it is pass a parameter derived from the profile as the username of those who run the loader program and pass it to the program loader so that the user name information is included in the loading

    example of

    input data
    123456, John, Smith
    654321, Jane Doe

    data loaded
    123456, John, Smith, July 3, 2009, USER13
    654321, Jane, Doe, July 3, 2009, USER13

    the sysdate is easy because it can be set in the column, but what I want to really realize is a parameter passed to the ctl file.

    Thanks in advance.

    Hello
    It's not easy to pass arguments to control the file all what you can do is change the controlfile by file option for your writing dynamically setting. If the user is the database user you can place the USER as a keyword as you where you will store sysdate.

    Thank you.

  • the formatting of char to number in sql loader control file

    I tried to load a huge csv Excel file into oracle with sql loader database. But a column contains numbers of year as '2014', ' 2015 ". In the control file, I have defined as:

    column_name decimal (38) external "TO_NUMBER (: column_name, ' 9999').

    It awlays say: ORA-01722 invalid number format. I changed the format of different number. All this has not worked. Please help me on this.

    1. the data of table column type is number (38.0)

    2. data csv file looks like this: color is the number of year.

    04/03/15, D_2-15, 10953562, 11116, 27144, 03/03/15,2015

    04/03/15, P_1-58, 1143088, 5262, 12994, 03/03/15,2015

    04/03/15, Q_1-31_Distinct_WWE, 7576633, 22352, 52975, 03/03/15,2015

    Thanks in advance.

    We can not help you unless you provide a sample of documents failed. The sample you provided loads without any problems:

    SQL > CREATE TABLE MY_TABLE)
    2 COLONNE_1 DATE,
    3 COLUMN_2 VARCHAR2 (255 BYTE).
    COLUMN_3 VARCHAR2 (255 BYTE) 4.
    COLUMN_4 VARCHAR2 (255 BYTE) 5.
    6 COLUMN_5 VARCHAR2 (255 BYTE).
    7 COLONNE_6 DATE,
    8 BUSINESS_YR NUMBER(*,0)
    9                      )
    10.

    Table created.

    SQL > home
    Microsoft Windows [Version 6.1.7600]
    Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

    C:\app\xxx\product\11.2.0\dbhome_2\BIN>type c:\temp\xx.ctl
    DOWNLOAD THE DATA
    CHARACTERSET US7ASCII

    INFILE *.
    TRUNCATE
    IN THE TABLE MY_TABLE
    FIELDS ENDED BY ',' POSSIBLY FRAMED BY "" "
    TRAILING NULLCOLS
    (
    COLONNE_1 DATE "MM-DD-AA.
    COLUMN_2 CHAR (255),
    COLUMN_3 CHAR (255),
    COLUMN_4 CHAR (255) NULLIF COLUMN_4 = BLANKS,
    COLUMN_5 CHAR (255) NULLIF COLUMN_5 = BLANKS,
    COLONNE_6 DATE "MM-DD-YY."
    BUSINESS_YR EXTERNAL INTEGER (38)
    )
    BEGINDATA
    03/20/15,1P-11,1111.22,,,03/22/15, 2014
    21/03/15, M_XXX-4, 5607817, 0, 0, 03-9/22/15, 2014
    22/03/15, M_DDD-2, 54990, 0, 0, 03-8/22/15, 2014
    23/03/15, R_1-46, 5297481, 24, 24, 03/22/15, 2014
    16/03/15, X_1 - 48 a, 8547274, 13474, 13474, 15/03/15, 2015
    03/17/15,1T-15-dental,2118.12,,,03/15/15, 2015
    18/03/15, 1 S - 1S, 555, 15/03/15, 2015
    19/03/15, P_NNN-7, 7455342, 10941, 10941, 03/15/15, 2015
    C:\app\xxx\product\11.2.0\dbhome_2\BIN>sqlldr control=c:\temp\xx.ctl log=c:\temp\xx.log
    Username:Scott
    Password:

    SQL * Loader: release 11.2.0.3.0 - Production on Sun Apr 5 06:28:06 2015

    Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

    Commit the point reached - the number of logical records 7
    Commit the point reached - the number of logical records 8

    C:\app\xxx\product\11.2.0\dbhome_2\BIN>exit

    SQL > column column_2 format a15
    SQL > column column_3 format a10
    SQL > column column_4 format a8
    SQL > column column_5 format a8
    SQL > select * from my_table
    2.

    COLUMN_1, COLUMN_2, COLUMN_3, COLUMN_4 COLUMN_5 COLONNE_6 BUSINESS_YR
    --------- --------------- ---------- -------- -------- --------- -----------
    MARCH 20, 15 1 P - 11 1111.22 2014 22 MARCH 15
    21 MARCH 15 M_XXX-9-4 5607817 0 0 22 MARCH 15 2014
    22 MARCH 15 M_DDD-8-2 54990 0 0 22 MARCH 15 2014
    23 MARCH 15 R_1-46 5297481 24 24 22 MARCH 15 2014
    16 March 15 X_1-48 has 8547274 13474 13474 15 March 15 2015
    March 17, 15 1 t 15-dental 2118.12 15 March 15 2015
    1 S - 1 S 18 MARCH 15 555 2015 15 MARCH 15
    MARCH 19, 15 P_NNN-7 7455342 10941 10941 15 MARCH 15 2015

    SY.

  • SQL * Loader Control File - Error 510

    Hello!

    I am trying to load a file TXT using SQL * Loader, my control file is a little too big I guess: 83KO.

    The problem is the message I get:

    SQL * Loader: release 10.2.0.3.0 - Production on Qua game 16 11:18:58 2009

    Copyright (c) 1982, 2005, Oracle. All rights reserved.

    SQL * Loader-510: O registro fisico dados (C:\Teste\Exe548teste_zanthus.old.ctl) e but full o' maximo land (2147473647).

    The language is Brazilian Portuguese.

    But the size of the file is only 83 KB, not the maximum size. I'm confused.

    The data is a TXT file with more than 1000 characters per line.
    The problem is that the generated control file is 'bigger' than the maximum. The error is not from the data file (error in the control file, not the data file). If you want I can put the file here and a sample of the data file too.

    I guess that is not find expressions of the folklore of the control file, but there a tank < ENTER > at the EOF (CR + LF (I think).

    I really want to split the data file or in multiple files control file and then control the import with the software, which would be boring...

    I don't know if this information helps but my control file using multiple INTO TABLE...

    Thank you!

    I still feel that the problem is the end character.

    André Luis wrote:

    The comparison is ok since I have already tested with a small control file.

    The problem is not the size of the file, the problem is the size of the line, with a small control file sql loader to read the file only online, and in this case it works because it is under the limit for the size of the line. (The smal file perhaps has the same problems with the characters of late, but due to its size it recount not error.)

    I hope that I missed something in the creation of the control file, I think he tries to read data from it, despite the fact that I have to tell him otherwise, because I saw something to tell the size limit for a control file with data inside...

    The control file syntax is OK, I don't think that he search data in the control file.

    I insist on the fact that you are creating the control file with another editor, otherwise...

  • SQL loader - control files

    Hi all

    I have a file with data. I want to insert only the exp_data < = current data in the control file. My like this.

    DOWNLOAD THE DATA

    INFILE ' D:\sample. DAT'

    TRUNCATE

    IN THE TABLE s_TABLE WHEN (1:6) < = "(to_char(sysdate,'mmddyy')).

    TRAILING NULLCOLS

    (

    eff_data position(1:6).

    name position(7:20)

    )

    During the execution of this I got error like this

    SQL * Loader-350: at line 48 syntax error.
    Illegal combination of nonalphanumeric characters
    IN THE TABLE s_TABLE WHEN (1:6) < = "(to_char (sysdate, e

    If I use with less symbol I receives the data. Is another way to achieve this scenario. If you need more data I'll provide you with.

    Thank you.

    Hello

    Some examples of data.

    011413DBTEST

    011513DBDATAFORTEST

    102313DATA

    Table as:

    Create the table s_TABLE

    (

    eff_data varchar2 (6).

    name varchar2 (20)

    )

  • Option of SQL loader control file

    Hello

    I just started using sql loader and I doubt as a requirement.

    I used to get the first data file with 10 columns excel. We got a table with 10 columns backend and were load this excel file using sql loader.

    but since last week, they changed the data file and are now sending the data in column 8. what my condition is, for the other 2 columns, I want to insert text 'COLUMN_DROPPED' in the backend table. Rest 8 columns must be filled as usual.
    How can I handle files of control for this option?

    I just want to know the option that I why I am not providing control file.

    Thank you
    Puneet

    974647 wrote:
    My requirement is for the other 2 columns, I want to insert text 'COLUMN_DROPPED' in the backend table. Rest 8 columns must be filled as usual.

    First of all, it is only possible if remaining 2 column datatype is string (char/nchar, varchar2/nvarchar2, clob/nclob) and is at least 14 characters long. The rest is easy. Just change 2 last control file fields:

    column9  constant 'COLUMN_DROPPED',
    column10 constant 'COLUMN_DROPPED'
    

    SY.

  • How to call sql loader control file with in the pl/sql procedure

    Hi friends,

    I am doing a project in relation to the transfer data using queues. In the queue, I'll get a data delimited by tabs in the form of CLOB variable/message. I don't want to keep this dat in the oracle table.
    During the updating of the data in the table.

    1. don't want to write data to a file. (You want to access directly after the specific queue).

    2. as the data is in the form of delimited by tabs, I want to use sql loader concept.

    How can I call the ctrl charger sql file with in my pl/sql procedure. When I searched, most forums recommending the external procedure or a Java program.

    Please guide me on this issue. My preferrence is pl sql, but don't know the external procedure. If no other way, I'll try Java.

    I'm using oracle 9.2.0.8.0.

    Thanks in advance,
    Vimal...

    Or SQL * Loader, or external tables are designed to read data from a CLOB stored in the database. They both work on files stored on the file system. If you don't want the data to be written to a file, you have to roll your own parsing code. It is certainly possible. But it will be much less effective than SQL * Loader or external tables. And it is likely to lead to a little more code.

    The simplest possible thing that might work would be to use something like Tom Kyte string tokenization package to read a line in the CLOB, divide the component parts and save the different chips in a significant collection (i.e. an object type or a record type that matches the table definition). Of course, you need manage things like the conversion of strings to numbers or dates, rejecting the lines, writing to log files, etc.

    Justin

  • Problem with SQL * Loader control file

    Hi friends,

    I use the following control file.
    Load Data
    infile *
    BADFILE xx_ds_po_upload_bad_file.bad
    APPEND
    INTO TABLE xx_ds_po_upload_hdr
    when (1) = 'HDR'
    FIELDS TERMINATED BY "     "
    TRAILING NULLCOLS
         (         
             header_id "xx_ds_poupload_hdr_s.nextval"              
            ,Supplier_Number
            ,Supplier_Site_Code
            )
    INTO TABLE xx_ds_po_upload_lnr
    when (1) = 'LNR'
    FIELDS TERMINATED BY "     "
    TRAILING NULLCOLS
         (         
             header_id "xx_ds_poupload_hdr_s.currval"              
            ,Organization_code
            ,Item
            ,quantity
            ,need_by_date
            ,line_id   "xx_ds_poupload_lnr_s.nextval"  
            )
    Here is my data file
    HDR     123     001
    LNR     xxS     XX     5     05
    When I insert the data, the program ends normally but given correct will not be inserted...

    It is the way in which the data is inserted in the tables
    Header Table
    
    HEADER_ID SUPPLIER_NUMBER                SUPPLIER_S
    --------- ------------------------------ ----------
           32 123                            001
    Line table
    HEADER_ID   LINE_ID ORG ITEM                  QUANTITY NEED_BY_D
    --------- --------- --- -------------------- --------- ---------
           32     10015 05
    Of the foregoing, in the table of the line, we can see that 05 is inserted for organization_code and since we gave "TRAILING BY NULL COLUMNS" program has no error on and the other fields are NULL.

    Can you please why 05 is taken for organization_code when xSS should be taken according to the data files?

    Please advise on this

    Kind regards
    Anthony Alix.

    Published by: Anthony Alix on April 29, 2010 11:32

    A load of table multiple when one later IN THE TABLE
    clause starts the position is NOT defined at the beginning of the
    logic automatically.

    This is train how to rewrite your code to get the right result
    Load data
    ...
    IN THE TABLE xx_ds_po_upload_hdr
    When (1) = 'HDR '.
    ...
    IN THE TABLE xx_ds_po_upload_lnr
    When (1) = 'LNR.
    ...
    header_id POSITION (1) "xx_ds_poupload_hdr_s.currval".
    Organization_code
    ...

  • SQL Loader control file (.ctl) given in table

    Hello

    I have a table 'region' in my schema called dss.
    SQL > desc region
    R_REGIONKEY
    R_NAME
    R_COMMENT
    I want to LOAD the data into this table of the region in a file called "region.tbl" located at d:\tpch\region.tbl, using a CONTROL file that is also on the the same place is to say d:\tpch\region.ctl.

    Region.tbl file contains few records. Recording of a SAMPLE of region.tbl is as follows:

    * 1 | AMERICA | HS ironic use, same request. s | *

    Region.CTL file contains the following lines to load data using sql loader:

    DOWNLOAD THE DATA
    INFILE'd:\tpch\region.tbl'
    IN THE REGION OF THE TABLE
    FIELDS TERMINATED BY ' |'
    * (R_REGIONKEY, R_NAME, R_COMMENT) *.

    so I go to the command prompt, navigate to the location of the above files and run the command:
    D:\TPCH > sqlldr control = region.ctl dss/dss = userid
    and get the following error:

    SQL * Loader-128: unable to start session
    ORA-01017: name of user and password invalid. connection refused

    I have the same table under the "system" user creation, but I get a different error with this that is:

    SQL * Loader-941: error when the table REGION describe statement
    ORA-04043: object REGION does not exist

    Using Oracle 11 g on my Windows XP.

    I'll appreciate the valuable suggestion.

    Thank you very much.

    Best regards
    Kam

    You can connect with dss/dss? For example, what

    sqlplus dss/dss
    

    If no, and you are sure that the name of username/password combination is correct, have you checked things like $ORACLE_SID - i.e. it points to the right database?

  • SQL * Loader Control path

    Hi all


    I created a sql * simultaneous program of charger with a parameter to pass the path of the data file with file name. Now my question is how does the program know that the control file is in a specific path.

    For example, I kept the control file in the $XXX_TOP/bin and the data file in the $XXX_TOP.

    I have now in the program parameter, pass the path of the data file, but how the program takes the path of the default control file $XXX_TOP/bin.

    Thanks and greetings
    El M

    I created a sql * simultaneous program of charger with a parameter to pass the path of the data file with file name. Now my question is how does the program know that the control file is in a specific path.

    For example, I kept the control file in the $XXX_TOP/bin and the data file in the $XXX_TOP.

    I have now in the program parameter, pass the path of the data file, but how the program takes the path of the default control file $XXX_TOP/bin.

    You can provide information on the data file in the control file, or switch the full directory path and the name of your file as an argument. Concurrent Manager passes the "data = (full path of the data file)" token at query execution time. Without a data file name, the concurrent manager ignores this token and SQL * Loader uses the data file name specified in the control file.

    http://docs.Oracle.com/CD/E18727_01/doc.121/e12897/T302934T458254.htm#4163833

    The control file must be placed in the directory XX_TOP/bin $.

    http://oracleapplications99.blogspot.ca/2011/12/sqlloader-examples.html
    http://imdjkoch.WordPress.com/2010/08/12/registering-SQL-Loader-as-a-concurrent-program/
    http://erpschools.com/articles/SQL-Loader

    Thank you
    Hussein

  • SQL Loader Bad File - line number

    Is there a way to get the line number of records in the bad file or remove file?

    Thank you

    Hello
    I think you get the line number of the lines could not load in the log file. The fault lines are lines you will find in the wrong file.
    I don't know if the log contains the line numbers of the lines scrapped.

    Liron Amitzi
    Consultant senior s/n
    [www.dbsnaps.com]
    [www.obiumsoftware.com]

  • Attempt to create run time (dynamic) table and insert the data in this... The entrance is a flat file (txt file) which has the numbers and strings... I'm trying to convert them to a string and insert into the table. It is a matter of urgency for me please

    create or replace procedure Dynamic_Table AS

    iVal VARCHAR2 (32);

    iTemp varchar (200): = ";

    sql_stmt VARCHAR2 (200);

    l_file1 UTL_FILE. TYPE_DE_FICHIER;

    l_file utl_file.file_type;

    BEGIN

    l_file1: = UTL_FILE. FOPEN ('TEST', 'dinput.txt', 'R');

    EXECUTE IMMEDIATE ' CREATE TABLE baseline (Item_ID varchar2 (32))';

    Loop

    BEGIN

    UTL_FILE. GET_LINE (l_file1, iVal);

    EXECUTE IMMEDIATE ' insert into baseline values (: ival) "using ival;

    EXCEPTION

    WHEN No_Data_Found THEN EXIT;

    While some OTHER THEN dbms_output.put_line (SQLERRM); * /

    END;

    end loop;

    END;

    You are approaching this the wrong way.  Create an external table based on the file.  External tables are CSV, fixed width data in a queryable table.

    You will need to create an oracle directory to put the file in (MY_ORA_DIR) I leave it for you to do, and then perform the following...

    create table BASELINE)

    ITEM_ID varchar2 (32)

    )

    EXTERNAL ORGANIZATION

    (

    TYPE ORACLE_LOADER

    THE DEFAULT DIRECTORY MY_ORA_DIR

    ACCESS SETTINGS

    (

    RECORDS DELIMITED BY NEWLINE

    LOGFILE "dinput.log".

    BADFILE "dinput.bad."

    NODISCARDFILE

    FIELDS

    (

    ITEM_ID

    )

    )

    LOCATION ("dinput.txt")

    )

    REJECT LIMIT UNLIMITED

    /

    All the dubious records appear in dinput.bad. Dinput.log will give you information.

    External tables are read-only, so once you set up your file, you can create editable as a normal table.

    create table ITABLE_EDITABLE as

    Select * from BASELINE

    /

    Work done, a few lines of code.

  • Can I use function defined by the user in the control file Sql Loader?

    Hi Master,

    Can I use fuction user-defined in the sql loader control file? Please advise... !!

    If you can provide an example... It's very kind of you.

    Concerning

    AR

    Here are a few examples that should give you clues: Sql loader

    I seriously wonder if why you use the century previous SQL * Loader instead of a external table:

    ORACLE-BASE - external Tables: querying data from flat files in Oracle


  • SQL Loader mystery

    Would appreciate any help. 10.2.0.4 standard Edition on Windows 2003 64-bit.

    My definition of the table is:
    create table cfive (keywords varchar2(4000));
    My SQL Loader Control file is:
    LOAD DATA 
    INFILE 'C:\Documents and Settings\Administrator.HORAE\Desktop\testdata.txt' 
    APPEND 
    INTO TABLE import.cfive 
    FIELDS TERMINATED BY ',' 
    OPTIONALLY ENCLOSED BY '"' 
    TRAILING NULLCOLS 
    (KEYWORDS)
    And my data are:

    'active wear, young, ballerina, ballerina, ballet, ballerinas, Pointe Shoes,
    Body, clothes, clothing dance, dancer, sweet, graceful, dance, education, shoes,
    inside, instruction, isolation, Leotard, tutu, pensive, people, performance, skill, solitude,.
    women, the preparation, the tying, studio shot.

    (I broke which on several lines here, but in reality, it's a whole long line of text).

    I invoke sqlloader as follows:
    sqlldr import/xxxxxxx control=testctl.txt log=testlog3.txt bad=testbad3.txt
    The program ends, but generates a log file that includes this:
    Control File:   testctl.txt
    Data File:      C:\Documents and Settings\Administrator.HORAE\Desktop\testdata.txt
      Bad File:     testbad3.txt
      Discard File:  none specified
     
     (Allow all discards)
    
    Number to load: ALL
    Number to skip: 0
    Errors allowed: 50
    Bind array:     64 rows, maximum of 256000 bytes
    Continuation:    none specified
    Path used:      Conventional
    
    Table IMPORT.CFIVE, loaded from every logical record.
    Insert option in effect for this table: APPEND
    TRAILING NULLCOLS option in effect
    
       Column Name                  Position   Len  Term Encl Datatype
    ------------------------------ ---------- ----- ---- ---- ---------------------
    KEYWORDS                            FIRST     *   ,  O(") CHARACTER            
    
    Record 1: Rejected - Error on table IMPORT.CFIVE, column KEYWORDS.
    Field in data file exceeds maximum length
    
    Table IMPORT.CFIVE:
      0 Rows successfully loaded.
      1 Row not loaded due to data errors.
      0 Rows not loaded because all WHEN clauses were failed.
      0 Rows not loaded because all fields were null.
    .. .and my line of data is not loaded. The log file says that keywords data of excessive length, but is of course not: the table allows 4000 characters, actual data are only 286 characters long.

    The database using WE8ISO8859P1 character set, bytes and characters should be equivalent to this opportunity.

    I'm looking for indications as to why it does not work! Thank you in advance.

    Try to specify the maximum length of the data entry in SQL * Loader control file:

    LOAD DATA
    INFILE 'testdata.txt'
    INTO TABLE cfive
    FIELDS TERMINATED BY ','
    OPTIONALLY ENCLOSED BY '"'
    (keywords char(4000))
    {code}
    
    with testdata.txt on 1 line:
    {code}
    "active wear,young,ballerina,ballet dancer,ballet dancing,ballet slippers,pointe shoes,soft,bodysuit,clothing,dance wear,dancer,graceful,dancing,educated,female,footwear,indoors,instruction,isolation,leotard,tutu,pensive,people,performing,skill,solitude,women,preparing,tying,studio shot"
    {code}
    
    I get:
    {code}
    type testdata.log
    
    SQL*Loader: Release 10.2.0.1.0 - Production on Fri Oct 2 09:40:33 2009
    
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    
    Control File:   testdata.ctl
    Data File:      testdata.txt
      Bad File:     testdata.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 256000 bytes
    Continuation:    none specified
    Path used:      Conventional
    
    Table CFIVE, loaded from every logical record.
    Insert option in effect for this table: INSERT
    
       Column Name                  Position   Len  Term Encl Datatype
    ------------------------------ ---------- ----- ---- ---- ---------------------
    KEYWORDS                            FIRST  4000   ,  O(") CHARACTER
    
    value used for ROWS parameter changed from 64 to 63
    
    Table CFIVE:
      1 Row successfully loaded.
      0 Rows not loaded due to data errors.
      0 Rows not loaded because all WHEN clauses were failed.
      0 Rows not loaded because all fields were null.
    
    Space allocated for bind array:                 252126 bytes(63 rows)
    Read   buffer bytes: 1048576
    
    Total logical records skipped:          0
    Total logical records read:             1
    Total logical records rejected:         0
    Total logical records discarded:        0
    
    Run began on Fri Oct 02 09:40:33 2009
    Run ended on Fri Oct 02 09:40:33 2009
    
    Elapsed time was:     00:00:00.08
    CPU time was:         00:00:00.03
    

    and

    SQL> select length(keywords) from cfive;
    
    LENGTH(KEYWORDS)
    ----------------
                 286
    

    I use the customer of Oracle 10.2.0.1 database and Oracle 10.2.0.4 EE database.

Maybe you are looking for