Name of dynamic INFILE SQL loader

Hi all

I use oracle 10g on windows server.

I have a log on a remote server. each line in the log file is as below

LogIN Mar 02/09/2014 10:10:48 ss18 N419FS40 1

I create a table for that as below;

Create table free_pc (log_in varchar2(10),log_day varchar2(10),log_date date,log_time date,log_user varchar2(30),log_Lab varchar2(30),log_pc varchar2(30), log_status char(1));

I have two problems;

1 N419FS40, the N419 is the name of a student in the lab, while FS40 is the name of the computer in this laboratory. I want only the first four characters to be inserted into the column of Log_lab and the rest of characters iin Log_pc column. my control file is less than

DOWNLOAD THE DATA

INFILE '\\remote_location\login02_09_14.txt '.

ADD

IN THE TABLE free_pc

FIELDS FINISHED WITH A WHITE SPACE

(log_in,

log_day,

log_date DATE "DD/MM/YYYY",

log_time DATE "HH24 MI SS."

LOG_USER,

log_Lab,

log_PC,

log_status

)

How to do this?

2. the log file is generated on the server, every day with a different name, he cancatenate the current date with Word LOGIN, for example login02_09_14.txt, login03_09_14.txt and login04_09_14 etc. in my INFILE tag, how can I put the name, so that it automatically take the name of the remote location?

Thank you.

Kind regards.

1. you can use the SUBSTR function to separate the two values.  You put the fields in the control file in the same order in the data file, with all the columns that are formulated from data in other areas at the end.

2. There are different ways to do this.  The file name can be in the control file or the SQL * Loader command line.  You can create either using SQL/SQL * Plus or operating system commands.  I tend to prefer change just the line of SQL * Loader command line, instead of the entire control file.  I prefer to do this in a SQL file instead of a file breaks Windows or * ix shell script or something, so that it is independent of the operating system.

In addition, it is best to store all of your day, date and time in a column, then you can use to_char to display it as you want, in a column, or two or three.

Please see the example below, in which I have shown above.

Scott@ORCL >-data file you provided with the name changed to include today's date:

Scott@ORCL > HOST TYPE 'c:\remote_location\login27_04_15.txt '.

Opening on Tuesday, September 2, 2014 ss18 N419FS40 1 10:10:48

Scott@ORCL >-control file with no infile, fields in the order of the data file, using fill for the unused columns,.

Scott@ORCL >-with forumulated columns, using boundfiller for filling necessary for columns columns drawn up:

Scott@ORCL > test.ctl TYPE of HOST

DOWNLOAD THE DATA

ADD

IN THE TABLE free_pc

FIELDS FINISHED WITH A WHITE SPACE

TRAILING NULLCOLS

(log_in,

log_day FILLING,

log_date BOUNDFILLER,

log_time BOUNDFILLER,

LOG_USER,

log_Lab ' SUBSTR (: log_lab, 1, 4). "

log_status,

log_date_time ' TO_DATE (: log_date |: log_time, "MM/DD / YYYYHH24:MI:SS'"). "

log_PC ' SUBSTR (: log_lab, 5) ')

Scott@ORCL >-sql script which now enables to get the data and it concatenates the file name with the path of the directory

Scott@ORCL >- and loads the data running SQL * Loader of SQL * Plus, using the HOST command:

Scott@ORCL > test.sql TYPE of HOST

COLUMN data_file new_value data_file

SELECT 'c:\remote_location\login ' | TO_CHAR (SYSDATE, 'DD_MM_YY'). ".txt" AS data_file FROM DUAL

/

HOST SQLLDR scott/tiger CONTROL = test.ctl DATA = '& data_file' LOG = test.log

CLEAR COLUMN

Scott@ORCL >-table which includes the date and time in a column, for the day of the week can be extracted:

Scott@ORCL > create table free_pc

2 (log_in varchar2 (10))

3, date log_date_time

4, log_user varchar2 (30)

5, log_Lab varchar2 (30)

6, log_pc varchar2 (30)

7, log_status char (1))

8.

Table created.

Scott@ORCL >-load data file sql running running SQL * Loader using the control file:

Scott@ORCL > test.sql START

Scott@ORCL > data_file new_value data_file COLUMN

Scott@ORCL > SELECT 'c:\remote_location\login ' | TO_CHAR (SYSDATE, 'DD_MM_YY'). ".txt" AS data_file FROM DUAL

2.

DATA_FILE

------------------------------------

c:\remote_location\login27_04_15.txt

1 selected line.

Scott@ORCL > HOST SQLLDR scott/tiger CONTROL = test.ctl DATA = '& data_file' LOG = test.log

SQL * Loader: release 11.2.0.1.0 - Production on my Apr 27 12:00:53 2015

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

Commit the point reached - the number of logical records 1

Scott@ORCL > CLEAR COLUMN

Scott@ORCL >-results with Date_Time field displayed in the form of day, date and time:

Scott@ORCL > log_in COLUMN FORMAT A6

Scott@ORCL > log_day COLUMN FORMAT A7

Scott@ORCL > log_user COLUMN FORMAT A8

Scott@ORCL > log_lab COLUMN FORMAT A8

Scott@ORCL > log_pc COLUMN FORMAT A6

Scott@ORCL > log_status FORMAT A10 COLUMN

Scott@ORCL > SELECT log_in,.

2 TO_CHAR (log_date_time, ' HH24:MI:SS Dy DD-Mon-YYYY ') ' DAY DATE TIME. "

3 log_user, log_lab, log_pc, log_status

4 FROM free_pc

5.

LOG_IN DAY DATE TIME LOG_USER LOG_LAB LOG_PC LOG_STATUS

------ ------------------------------------------ -------- -------- ------ ----------

LogIN Mar 02 - Sep - 2014 ss18 N419 FS40 1 10:10:48

1 selected line.

Tags: Database

Similar Questions

  • [SQL * Loader] ORA-01747 on column name 'INDEX '.

    Hello

    I use SQL * Loader to load the test data for the CSV files. I have a column whose name is "INDEX". SQL * Loader works very well under Linux (Red Hat 6 - Client Oracle 11.2.0.1.0) but I encounter ORA-01747 launch my Workstation Windows (Oracle Server 11.2.0.1.0).

    For more information, I target the same instance (Red Hat 6 - Oracle Server 11.2.0.1.0).

    You have an idea how to solve the problem (without renaming the column )?

    Thanks for any help you can provide.

    I finally find the solution surrounding the column name with double quotes ("") within the control file. Thank you to remember the format of "protector".

  • Option to enter the name of data file in SQL * Loader

    Hello

    I have a requirement to enter the name of the data file in the staging table, is it possible that I can capture in SQL * Loader or any other way to do it.

    Need suggestion of experts please.

    Thank you

    Genoo

    Genoo salvation,

    Please have the basename command in Linux to enter the name of the file that is currently running. I don't have a linux machine at the moment access, so please check at your end.

    BTW, as you file name of variant data in and values not consistent, you need to change the data file to include the file name. Unless it is approved for your management I don't see alternatives like the fill source tables are the data file. If this is approved then you can do the following:

    SED EI / $/ ' basename $0' /'-i '.

    Thus, for example, if you have a data file name 01test.csv, and it contains data such as:

    11, AAA, ABC

    22, BBB, BCD

    The command: sed EI / $/, ' basename $0' /'-i 01test.csv will go to:

    11, AAA, ABC, 01test.csv

    22, BBB, BCD, 01test.csv

    Then use SQL Loader to load the file

    It is the closest solution to you, I can think. There is no way that you can achieve your goal of features SQL Loader but rather, you should use technical Linux for a work around.

    Best regards

  • Problem loading xml using sql loader file

    I am trying to load data into the table test_xml (xmldata XMLType)

    I have an xml file and I want any file to load in a single column

    When I use the following control file and run from the command-line as follows
    sqlldr $1@$TWO_TASK direct control=$XXTOP/bin/LOAD_XML.ctl = true; :

    DOWNLOAD THE DATA
    INFILE *.
    TRUNCATE INTO TABLE test_xml
    XmlType (XMLDATA)
    FIELDS
    (
    tank fill ext_fname (100),
    XMLDATA LOBFILE (ext_fname) COMPLETED BY expressions of folklore
    )
    START DATA
    U01/appl/apps/apps_st/appl/XXTop/12.0.0/bin/file. XML

    the file is loaded in the table perfectly.

    Unfortunately I can't hard-code the name of file as file name will be changed dynamically.

    so I removed the block

    START DATA
    U01/appl/apps/apps_st/appl/XXTop/12.0.0/bin/file. XML

    control file and tried to run by giving the following command line path

    sqlldr $1@$TWO_TASK control=$XXTOP/bin/LOAD_XML.ctl direct data=/u01/APPL/apps/apps_st/appl/xxtop/12.0.0/bin/file.xml = true;

    But strangely it attempts to load each line of the xml file in the table instead of the whole file

    Please find the log of the program with the error

    ------------------------------------------------------------------
    Loading XML through SQL * Loader begins
    ------------------------------------------------------------------
    SQL * Loader-502: cannot open the data file ' <? XML version = "1.0"? > ' table field TEST_XML XMLDATA
    SQL * Loader-553: file not found
    SQL * Loader-509: System error: no such file or directory
    SQL * Loader-502: cannot open the data file '< root >' XMLDATA field table TEST_XML
    SQL * Loader-553: file not found
    SQL * Loader-509: System error: no such file or directory
    SQL * Loader-502: cannot open the data file '< ScriptFileType >' field XMLDATA table TEST_XML
    SQL * Loader-553: file not found
    SQL * Loader-509: System error: no such file or directory
    SQL * Loader-502: cannot open the data file ' < Type > forms < / Type > ' table field TEST_XML XMLDATA
    SQL * Loader-553: file not found
    SQL * Loader-509: System error: no such file or directory
    SQL * Loader-502: cannot open the data file ' < / ScriptFileType > ' table field TEST_XML XMLDATA
    SQL * Loader-553: file not found
    SQL * Loader-509: System error: no such file or directory
    SQL * Loader-502: cannot open the data file '< ScriptFileType >' field XMLDATA table TEST_XML
    SQL * Loader-553: file not found
    SQL * Loader-509: System error: no such file or directory
    SQL * Loader-502: cannot open the data file ' < Type > PLL < / Type > ' table field TEST_XML XMLDATA
    SQL * Loader-553: file not found
    SQL * Loader-509: System error: no such file or directory
    SQL * Loader-502: cannot open the data file ' < / ScriptFileType > ' table field TEST_XML XMLDATA
    SQL * Loader-553: file not found
    SQL * Loader-509: System error: no such file or directory
    SQL * Loader-502: cannot open the data file '< ScriptFileType >' field XMLDATA table TEST_XML

    Please help me how can I load full xml in a single column using command line without Hardcoding in the control file

    Published by: 907010 on January 10, 2012 02:24

    But strangely it attempts to load each line of the xml file in the table instead of the whole file

    Nothing strange, that the data parameter specifies the file containing the data to load.
    If you use the name of the XML here, the control file will try to interpret each line of XML as being separate ways.

    The traditional approach this is to have the name of the file stored in another file, say filelist.txt and use, for example:

    echo "/u01/APPL/apps/apps_st/appl/xxtop/12.0.0/bin/file.xml" > filelist.txt
    sqlldr $1@$TWO_TASK control=$XXTOP/bin/LOAD_XML.ctl data=filelist.txt direct=true;
    
  • SQL loader question

    Hi people,

    Please find the table with the records below

    CREATE TABLE EMPLOYEE_LOAD (ID NUMBER, NAME VARCHAR2 (100), UNIVERSITY_NAME VARCHAR2 (100));

    File to load: employee.txt

    ID | NAME | UNIVERSITY_NAME

    1. JAMES | UNIVERSITY OF MIT

    2. LISA | UNIVERSITY OF CAMBRIDGE

    3. MINDY | "THIS UNIVERSITY

    4. ' ALLEN J |' IT UNIVERSITY

    5. ' MIKE'ALLEN | "THIS UNIVERSITY

    I've written SQL Loader control as file below

    OPTIONS(SKIP=1,DIRECT=TRUE)

    DOWNLOAD THE DATA

    INFILE ' mnt/employee.txt.

    BADFILE "mnt/employee.bad.

    DISCARDFILE ' mnt/employee.dsc.

    ADD THE EMPLOYEE_LOAD TABLE

    FIELDS TERMINATED BY ' | '. SURROUNDED OF POSSIBLY ' ' ' TRAILING NULLCOLS

    (

    ID,

    NAME,

    UNIVERSITY_NAME

    )

    sqlldr userid = < username > @database/password control=/mnt/employee.ctl log=/mnt/employee.log

    Only 2 first recordings are loading (excluding the header) and face below errors

    (1) no terminator found after CLOSE and CLOSED field

    (2) second string for the attachment does not exist

    These 3 recordings are in the wrong files and how do I force sql loader to load subfolders too?

    3. MINDY | "THIS UNIVERSITY

    4. ' ALLEN J |' IT UNIVERSITY

    5. ' MIKE'ALLEN | "THIS UNIVERSITY

    Try to remove the ENCLOSED BY ' ' ' clause.  It is not true, according to your sample data.

    These quotes seem to be interspersed randomly.

  • SQL * Loader does not import data

    Hi all -

    I have a very basic package which should load data from a file delimited by tabs.  My problem is that when I run my package, no data is loaded. Although the correct number of records is created (based on relaxation of the table).  All records contain no data.

    OPTIONS (skip = 1, errors = 10, lines = 10000, direct = True)

    DOWNLOAD THE DATA

    INFILE "C:\ECOMMERCE\VFT\Marin\inbound\DSGSiteCatalystPassbackKeywords.csv" "str"\n"

    BADFILE "C:\ECOMMERCE\MFT\NxtGen_Catalog_Int\ErrorFiles\MARIN_DSG_KEYWORDS.bad."

    DISCARDFILE 'C:\ECOMMERCE\MFT\NxtGen_Catalog_Int\ErrorFiles\MARIN_DSG_KEYWORDS.dsc '.

    IN THE TABLE "ETL_STAGE". "" MARIN_KEYWORD ".

    ADD

    EVALUATE CHECK_CONSTRAINTS

    "FIELDS TERMINATED BY ' 09 X."

    TRAILING NULLCOLS

    (

    MARIN_KEYWORD_ID,

    KEYWORD,

    BUSINESS_DATE,

    EDITOR,

    ACCOUNT,

    CAMPAIGN,

    AD_GROUP,

    TYPE CHAR (100000),

    DESTINATION_URL,

    UNIQUE_ID,

    PUB_ID,

    PRINT,

    CLICKS,

    PUB_COST,

    ATTRIBUTED_CONVERSIONS_CONV,

    CLICK_PATH_CONV,

    LAST_CLICK_CONV,

    EMAIL_SIGNUPS_CONV,

    SCORECARD_SIGNUPS_CONV,

    STORE_LOCATOR_PAGE_CONV

    )

    My table creation script is:

    CREATE THE TABLE ETL_STAGE. MARIN_KEYWORD

    (

    MARIN_KEYWORD_ID VARCHAR2 (1000 BYTE),

    KEYWORD VARCHAR2 (1000 BYTE).

    BUSINESS_DATE VARCHAR2 (200 BYTE),

    EDITOR VARCHAR2 (1000 BYTE),

    ACCOUNT VARCHAR2 (1000 BYTE),

    CAMPAIGN VARCHAR2 (1000 BYTE),

    AD_GROUP VARCHAR2 (1000 BYTE),

    TYPE VARCHAR2 (1000 BYTE),

    DESTINATION_URL VARCHAR2 (1000 BYTE),

    UNIQUE_ID VARCHAR2 (1000 BYTE),

    PUB_ID VARCHAR2 (1000 BYTE),

    VARCHAR2 (1000 BYTE) PRINT,

    VARCHAR2 (1000 BYTE) CLICKS,

    PUB_COST VARCHAR2 (1000 BYTE),

    ATTRIBUTED_CONVERSIONS_CONV VARCHAR2 (1000 BYTE),

    CLICK_PATH_CONV VARCHAR2 (1000 BYTE),

    LAST_CLICK_CONV VARCHAR2 (1000 BYTE),

    EMAIL_SIGNUPS_CONV VARCHAR2 (1000 BYTE),

    SCORECARD_SIGNUPS_CONV VARCHAR2 (1000 BYTE),

    STORE_LOCATOR_PAGE_CONV VARCHAR2 (1000 BYTE),

    IMEX_LOG_REFERENCE_ID VARCHAR2 (1000 BYTE),

    DATE_ADDED DATE DEFAULT SYSDATE NOT NULL,.

    ADDED_BY VARCHAR2 (50 BYTES) BY DEFAULT USER NOT NULL,.

    DATE_LAST_MODIFIED DATE DEFAULT SYSDATE NOT NULL,.

    MODIFIED_BY VARCHAR2 (50 BYTES) BY DEFAULT USER NOT NULL,.

    RECORD_STATUS VARCHAR2 (1 BYTE) DEFAULT 'A' NOT NULL

    )

    TABLESPACE ECOM_DATA

    PCTUSED 0

    PCTFREE 10

    INITRANS 1

    MAXTRANS 255

    STORAGE)

    64K INITIALS

    ACCORDING TO 1 M

    MINEXTENTS 1

    MAXEXTENTS UNLIMITED

    PCTINCREASE 0

    DEFAULT USER_TABLES

    )

    LOGGING

    NOCOMPRESS

    NOCACHE

    NOPARALLEL

    MONITORING;

    The log displays the following text:

    SQL * Loader: release 11.2.0.2.0 - Production on Thu Jun 25 14:31:35 2015

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

    Control file: C:\ECOMMERCE\MFT\NxtGen_Catalog_Int\SQLLoaderScripts\MARIN_DSG_CREATIVES.ctl

    Data file: C:\ECOMMERCE\VFT\Marin\inbound\DSGSiteCatalystPassbackCreatives.csv

    Bad leadership: C:\\ECOMMERCE\MFT\NxtGen_Catalog_Int\ErrorFiles\MARIN_DSG_CREATIVES.bad

    Delete the file: C:\ECOMMERCE\MFT\NxtGen_Catalog_Int\ErrorFiles\MARIN_DSG_CREATIVES.dsc

    (Allow all releases)

    Number of loading: ALL

    Number of jump: 10

    Authorized errors: 50

    Link table: 64 lines, maximum of 256000 bytes

    Continuation of the debate: none is specified

    Path used: classics

    Table 'ETL_STAGE '. "" MARIN_CREATIVE ", 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

    ------------------------------ ---------- ----- ---- ---- ---------------------

    CREATIVE_ID PRIME * WHT O(") CHARACTER

    The maximum field length is 100,000

    HEADLINE THEN * CHARACTER O(") WHT

    BUSINESS_DATE NEXT * CHARACTER O(") WHT

    The SQL string for the column: 'TRIM(:BUSINESS_DATE) '.

    DESCRIPTION_LINE_1 NEXT * CHARACTER O(") WHT

    DESCRIPTION_LINE_2 NEXT * CHARACTER O(") WHT

    DISPLAY_URL NEXT * CHARACTER O(") WHT

    DESTINATION_URL NEXT * WHT O(") CHARACTER

    The maximum field length is 100,000

    EDITOR NEXT * CHARACTER O(") WHT

    THEN THE CAMPAIGN * CHARACTER O(") WHT

    AD_GROUP NEXT * CHARACTER O(") WHT

    UNIQUE_ID NEXT * CHARACTER O(") WHT

    PUB_ID NEXT * CHARACTER O(") WHT

    PRINT NEXT * CHARACTER O(") WHT

    The SQL string for the column: "replace (: print, ',',") "."

    CLICK ON NEXT * CHARACTER O(") WHT

    The SQL string for the column: "replace (: CLICKS, ',',") "."

    ATTRIBUTED_CONVERSIONS_CONV NEXT * CHARACTER O(") WHT

    CLICK_PATH_CONV NEXT * CHARACTER O(") WHT

    LAST_CLICK_CONV NEXT * CHARACTER O(") WHT

    EMAIL_SIGNUPS_CONV NEXT * CHARACTER O(") WHT

    SCORECARD_SIGNUPS_CONV NEXT * CHARACTER O(") WHT

    STORE_LOCATOR_PAGE_HITS_CONV NEXT * CHARACTER O(") WHT

    IMEX_LOG_REFERENCE_ID NEXT * CHARACTER O(") WHT

    Why WHT, showing when I use tabs?

    In addition, why is not display all the data in the files?

    NLS_CHARACTERSET WE8ISO8859P1
  • SQL Loader problem

    Hi I'm using version 11.2.0.3.0 version of oracle, and I'm trying to push the file using sql loader utility to my DB table, below is my table structure, two of the column will be constant appears as mentioned below in the table structure. And the File_DATE column must be the combination of two fields (Date and time) of flat file to have the appropriate data column format. I get the error message and not be able to download the data using slot control file, so need help.

    sample data file

    OrderDate, name, size, Records, Date, Time
    06202014, authlogfile06202014.txt, 40777214, 198915, June 21 at 03:51
    06202014, transferfile06202014.txt, 372144, 2255, June 21 at 01:34
    06202014, balancefile06202014.txt, 651075, 10343, June 21 at 03:28

    The table structure

    Create the table file_stats
    (Systemtypecode VARCHAR2 (4000)-this will be a value to hardcode "CBD")
    LETTER Date,
    FILENAME VARCHAR2 (4000).
    Size of the file Number (20.0).
    Noofrecords NUMBER (20.0).
    File_DATE VARCHAR2 (4000).
    CREATED_DATE Date - it will be filled with the value SYSDATE
    );

    Here's my control file

    Options
    (SKIP = 1)
    DOWNLOAD THE DATA
    INFILE 'files.csv '.
    ADD
    IN the file_stats table
    FIELDS TERMINATED BY ', '.
    (Systemtypecode CONSTANT 'CBD',
    LETTER DATE 'MMDDYYYY.
    CHAR FILE NAME,
    Size of the ENTIRE file,
    Noofrecords INTEGER,
    boundfiller TANK file_DATE_DDmon
    , file_DATE ' to_date ('2014':: file_DATE_DDmon:: file_DATE, 'YYYYMON DDHH24:MI').
    , created_date CONSTANT 'sysdate.
    )

    When running under command, all erroneous records on as below

    sqlldr schema1/pwd@db1 control = file_stats.ctl log = file_stats.log file_stats.bad = bad

    ERROR:
    Sheet 1: Rejected - error on the table FILE_STATS, column FILE_DATE.
    ORA-01843: not one month valid

    You must add TRAILING NULLCOLS and use EXTERNAL INTEGER instead of an INTEGER and your file_date column must be of type DATE data.  Please see the demo below with some additional corrections.  Note that since there is no year in the data file for the file_date column, which by default is the current year.  If you want to 2014 so you need to concatenate that and add the date format YYYY.

    Scott@orcl12c > files.csv TYPE of HOST

    OrderDate, name, size, Records, Date, Time

    06202014, authlogfile06202014.txt, 40777214, 198915, June 21 at 03:51

    06202014, transferfile06202014.txt, 372144, 2255, June 21 at 01:34

    06202014, balancefile06202014.txt, 651075, 10343, June 21 at 03:28

    Scott@orcl12c > file_stats.ctl TYPE of HOST

    OPTIONS (SKIP = 1)

    DOWNLOAD THE DATA

    INFILE 'files.csv '.

    ADD IN THE TABLE file_stats

    FIELDS TERMINATED BY ',' TRAILING NULLCOLS

    (systemtypecode CONSTANT "CBD"

    , odate DATE 'MMDDYYYY '.

    filename CHAR

    INTEGER EXTERNAL file size

    noofrecords INTEGER EXTERNAL

    file_date_ddmon BOUNDFILLER TANK

    , file_date DATE 'My DDHH24:MI' ': file_date_ddmon |: file_date '

    , created_date 'SYSDATE.

    )

    Scott@orcl12c > file_stats CREATE TABLE

    2 (systemtypecode VARCHAR2 (14),)

    3 DATE odate,.

    4 name of file VARCHAR2 (24).

    size of the file NUMBER 5 (20.0).

    6 noofrecords NUMBER (20.0).

    7 file_date DATE,

    8 created_date DATE)

    9.

    Table created.

    Scott@orcl12c > HOST SQLLDR scott/tiger CONTROL = file_stats.ctl LOG = file_stats.log file_stats.bad = BAD

    SQL * Loader: release 12.1.0.1.0 - Production on Thu Feb 5 15:26:49 2015

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

    Path used: classics

    Commit the point reached - the number of logical records 3

    Table FILE_STATS:

    3 rows loaded successfully.

    Check the log file:

    file_stats.log

    For more information on the charge.

    Scott@orcl12c > SELECT * FROM file_stats

    2.

    SYSTEMTYPECODE, KAI NOOFRECORDS FILE_DATE CREATED_DATE FILENAME FILE SIZE

    -------------- --------------- ------------------------ ---------- ----------- --------------- ---------------

    Friday, June 20, 2014 authlogfile06202014.txt 40777214 198915 Sunday 21 June 2015 CBD Thursday, February 5, 2015

    Friday, June 20, 2014 transferfile06202014.txt 372144 2255 Sunday 21 June 2015 CBD Thursday, February 5, 2015

    Friday, June 20, 2014 balancefile06202014.txt 651075 10343 Sunday 21 June 2015 CBD Thursday, February 5, 2015

    3 selected lines.

  • SQL loader error

    Hi all

    I wrote a check as file

    load data

    INFILE 'D:/ReddSX/SHIP/destroyed_books.csv '.

    in the t82dstry_new table

    fields completed by «,»

    (ID, DEALER, BEGINING_AGREEMENT, ENDING_AGREEMENT, COMMENTS, DATE

    )

    He saw 1231 documents but when execute sqlldr show

    C:\ > sqlldr dlradt/Budget12@cdrtst control=D:\ReddSX\t82dstry_new.ctl

    SQL * Loader: release 11.2.0.1.0 - Production on Wednesday, may 28 03:07:22 2014

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

    Commit the point reached - the number of logical records 52

    and he does not also 52 records in the table,

    What is the problem someone help me?

    Thank you

    David

    The control file you posted does not produce this error, since I use as DATE column name without enclosing in double quotes would not work.  You must post your real control file, a few examples of data, the structure of your table, your log file and some records of your incorrect file sample.  If you get a partial cargo, then your log file and the wrong file will most help you determine why.  If you do not have to specfy INSERT or another option, then by default to INSERT in all cases, but this requires that the table is empty.  You can use APPEND if the table is not empty.

  • Error loading data using SQL loader

    I get an error message like "SQL * Loader - 350 combination illegal syntax of non-alphanumeriques characters error during loading of a file using SQL loader in RHEL." The command used to run SQL * Loader is:

    Sqlldr userid = < user name > / < password > control = data.ctl

    The control file is data.ctl:

    DOWNLOAD the data

    INFILE ' / home/oraprod/data.txt'

    Add in the table test

    {

    EmpID completed by «,»,

    fname completed by «,»,

    lname completed by «,»,

    treatment is completed with a white space

    }

    The data.txt file is:

    1, Kaushal, Hamad, 5000

    2, Chetan, Hamad, 1000

    Hopefully, my question is clear.

    Please get back with the answer to my query.

    Concerning

    Replace "{" by "("dans votre fichier de contrôle) "

    DOWNLOAD the data

    INFILE 'c:\data.txt.

    Add the emp_t table

    (

    EmpID completed by «,»,

    fname completed by «,»,

    lname completed by «,»,

    treatment is completed with a white space

    )

    C:\>sqlldr user/pwd@database control = c.ctl

    SQL * Loader: release 10.2.0.3.0 - Production on Wed Nov 13 10:10:24 2013

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

    Commit the point reached - the number of logical records 1

    Commit the point reached - the number of logical records 2

    SQL > select * from emp_t;

    EMPID, FNAME LNAME SALARY

    ---------- -------------------- -------------------- ----------

    1 kone hamadi 5000

    2 Chetan Hamad 1000

    Best regards

    Mohamed Houri

  • 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)

    )

  • Date fromats loading using SQL * Loader

    Hello

    I have the data to load into an Oracle DB using sqlldr below

    333. 789. 6 ||| 01-08-2013 | 2014-08-01 |

    334. 789. 6 ||| 01-08-2013 | 2014-08-01 |

    335. 789. 6 ||| 01-08-2013 | 2014-08-01 |

    It fails while the failed to load on date formats. How can I fix everything by using load data.

    Thank you

    Sylvie

    Works for me. You must validate the CTL file.

    Here is an example:

    Control line: -.

    DOWNLOAD THE DATA

    INFILE *.

    IN THE TABLE test_table

    REPLACE

    FIELDS TERMINATED BY ', '.

    (

    Col DATE 'yyyy-mm-dd ".

    )

    BEGINDATA

    2013-08-01

    2014-09-01

    2015-10-01

    2016-11-01

    2017-12-01

    -Create table

    SQL > create table test_table (date of the pass);

    Table created.

    -SQL * Loader

    C:\Users\43729434>sqlldr user/password@db_alias name control=C:\fakepath\test_ctl.ctl

    SQL * Loader: release 11.2.0.1.0 - Production Tue Oct 24 10:26:40 2013

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

    Commit the point reached - the number of logical records 4
    Commit the point reached - the number of logical records 5

    -Check the data in the database

    SQL > alter session set nls_date_format = 'DD-Mon-YYYY ';

    Modified session.

    SQL > select col from test_table;

    COL
    -----------
    August 1, 2013
    01-sep-2014
    October 1, 2015
    November 1, 2016
    December 1, 2017

    SQL >

  • SQL Loader (how to cut data header)

    Hello

    [oracle 11g]


    I got the following text file:
    mod; DD.MM.YYYY; HH:MM:SS; aligned
    src; "ptv "; "15.04.2012"; "10:47:49"
    chs; "ISO8859-1"
    ver; "V1.0"
    ifv; "V1.0"
    dve; "V1.0"
    fft; "LIO"
    tbl; MENGE_FGR
    atr; BASIS_VERSION; FGR_NR; FGR_TEXT
    frm; num[9.0]; num[5.0]; char[40]
    rec;        122;     8; "VVZ"    
    rec;        123;     18; "VHZ"
    rec;        124;     13; "VTZ"    
    Now I am interested in the column TBL and ATR and follwing rawdata

    Can you see a way to automatically create the MENGE_FR table with columns BASIS_VERSION. FGR_NR; FGR_TEST and column types num, num, char and insert raw data below?

    PS:OK, it's mysql... .so I need to convert this sql first. So, you should see num as number.


    THX in advance Thorsten

    Published by: Thorsten on 16.05.2013 07:30

    Published by: Thorsten on 16.05.2013 07:32

    There are various ways you could do this. I demonstrated one of the methods below. I created a table with two columns, and then use SQL * Loader to load the data from the text file in these two columns. Skip header lines is optional. You can also use a portal instead, if the text file is located on your server, not your client. I then used some PL/SQL to create and run 'create table' and 'insert '. It's just a startup code. You will need to make changes to manage other types of data, and others who were not in the example you provided, but it should give you the general idea.

    SCOTT@orcl_11gR2> host type text_file.dat
    mod; DD.MM.YYYY; HH:MM:SS; aligned
    src; "ptv "; "15.04.2012"; "10:47:49"
    chs; "ISO8859-1"
    ver; "V1.0"
    ifv; "V1.0"
    dve; "V1.0"
    fft; "LIO"
    tbl; MENGE_FGR
    atr; BASIS_VERSION; FGR_NR; FGR_TEXT
    frm; num[9.0]; num[5.0]; char[40]
    rec;        122;     8; "VVZ"
    rec;        123;     18; "VHZ"
    rec;        124;     13; "VTZ"
    
    SCOTT@orcl_11gR2> host type test.ctl
    options(skip=7)
    load data
    infile text_file.dat
    into table tbl
    (col1 terminated by ';',
    col2 terminated by x'0a')
    
    SCOTT@orcl_11gR2> create table tbl
      2    (col1  varchar2(4),
      3     col2  varchar2(60))
      4  /
    
    Table created.
    
    SCOTT@orcl_11gR2> host sqlldr scott/tiger control=test.ctl log=test.log
    
    SQL*Loader: Release 11.2.0.1.0 - Production on Thu May 16 13:44:24 2013
    
    Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
    
    Commit point reached - logical record count 6
    
    SCOTT@orcl_11gR2> select * from tbl
      2  /
    
    COL1 COL2
    ---- ------------------------------------------------------------
    tbl   MENGE_FGR
    atr   BASIS_VERSION; FGR_NR; FGR_TEXT
    frm   num[9.0]; num[5.0]; char[40]
    rec          122;     8; "VVZ"
    rec          123;     18; "VHZ"
    rec          124;     13; "VTZ"
    
    6 rows selected.
    
    SCOTT@orcl_11gR2> declare
      2    v_tab   varchar2(30);
      3    v_atr   varchar2(32767);
      4    v_frm   varchar2(32767);
      5    v_sql   varchar2(32767);
      6    v_cols  number;
      7    v_next  varchar2(32767);
      8  begin
      9    select col2 into v_tab from tbl where col1 = 'tbl';
     10    select col2 || ';' into v_atr from tbl where col1 = 'atr';
     11    select col2 || ';' into v_frm from tbl where col1 = 'frm';
     12    v_sql := 'CREATE TABLE ' || v_tab || ' (';
     13    select regexp_count (col2, ';') + 1 into v_cols from tbl where col1 = 'atr';
     14    for i in 1 .. v_cols loop
     15      v_sql := v_sql || substr (v_atr, 1, instr (v_atr, ';') - 1) || ' ';
     16      v_next := substr (v_frm, 1, instr (v_frm, ';') - 1);
     17      v_next := replace (v_next, '[', '(');
     18      v_next := replace (v_next, ']', ')');
     19      v_next := replace (v_next, '.', ',');
     20      v_next := replace (v_next, 'num', 'number');
     21      v_next := replace (v_next, 'char', 'varchar2');
     22      v_sql := v_sql || v_next || ',';
     23      v_atr := substr (v_atr, instr (v_atr, ';') + 1);
     24      v_frm := substr (v_frm, instr (v_frm, ';') + 1);
     25    end loop;
     26    v_sql := rtrim (v_sql, ',') || ')';
     27    dbms_output.put_line (v_sql);
     28    execute immediate v_sql;
     29    for r in (select col2 from tbl where col1 = 'rec') loop
     30      v_sql := 'INSERT INTO ' || v_tab || ' VALUES (''';
     31      v_sql := v_sql || replace (replace (r.col2, ';', ''','''), '"', '');
     32      v_sql := v_sql || ''')';
     33      dbms_output.put_line (v_sql);
     34      execute immediate v_sql;
     35    end loop;
     36  end;
     37  /
    CREATE TABLE  MENGE_FGR ( BASIS_VERSION  number(9,0), FGR_NR  number(5,0),
    FGR_TEXT  varchar2(40))
    INSERT INTO  MENGE_FGR VALUES ('        122','     8',' VVZ')
    INSERT INTO  MENGE_FGR VALUES ('        123','     18',' VHZ')
    INSERT INTO  MENGE_FGR VALUES ('        124','     13',' VTZ')
    
    PL/SQL procedure successfully completed.
    
    SCOTT@orcl_11gR2> describe menge_fgr
     Name                                      Null?    Type
     ----------------------------------------- -------- ----------------------------
     BASIS_VERSION                                      NUMBER(9)
     FGR_NR                                             NUMBER(5)
     FGR_TEXT                                           VARCHAR2(40)
    
    SCOTT@orcl_11gR2> select * from menge_fgr
      2  /
    
    BASIS_VERSION     FGR_NR FGR_TEXT
    ------------- ---------- ----------------------------------------
              122          8  VVZ
              123         18  VHZ
              124         13  VTZ
    
    3 rows selected.
    
  • Error loading XML file in the column of XMLTYPE through SQL loader

    Hi gurus,

    I am trying to load the XML file into the column of XMLTYPE through SQL Loader but the errors themselves. Here are the details

    Databases
    SQL*Plus: Release 10.2.0.3.0 - Production on Tue Jul 24 17:17:55 2012
    
    Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.
    
    
    Connected to:
    Oracle Database 10g Release 10.2.0.3.0 - 64bit Production
    
    BANNER
    ----------------------------------------------------------------
    Oracle Database 10g Release 10.2.0.3.0 - 64bit Production
    PL/SQL Release 10.2.0.3.0 - Production
    CORE    10.2.0.3.0      Production
    TNS for Linux: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - Production
    The table structure
    CREATE TABLE TH_XML
    (
      COL_ID_1   VARCHAR2(100 BYTE),
      IN_FILE_1  XMLTYPE
    )
    XMLTYPE IN_FILE_1 STORE AS CLOB (TABLESPACE SMDAT)
    XML (simple.xml) file
    <?xml version="1.0"?>
     <catalog> 
     <book id="bk101"> 
               <author>Some Author1</author> 
               <title>Some Title1</title> 
               <genre>Computer</genre> 
               <price>44.95</price> 
               <publish_date>2000-10-01</publish_date> 
               <description>creating applications</description> 
       </book> 
       <book id="bk112"> 
               <author>Some Author2</author> 
               <title>Some Title2</title> 
               <genre>Computer</genre> 
               <price>49.95</price> 
               <publish_date>2001-04-16</publish_date> 
               <description>Microsoft Visual Studio 7 is explored in depth</description> 
    </book> 
    </catalog>
    Control file
    LOAD DATA
    INFILE 'c:\simple.xml'
    APPEND
    INTO TABLE TH_XML 
    XMLTYPE(in_file_1)
    (
    col_id_1 filler  CHAR (100),
    in_file_1 LOBFILE(CONSTANT "c:\simple.xml") TERMINATED BY EOF
    )
    LOG file
    SQL*Loader: Release 10.2.0.3.0 - Production on Tue Jul 24 16:42:25 2012
    
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    
    Control File:   c:\my_file.ctl
    Data File:      c:\simple.xml
      Bad File:     c:\simple.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 TH_XML, loaded from every logical record.
    Insert option in effect for this table: APPEND
    
       Column Name                  Position   Len  Term Encl Datatype
    ------------------------------ ---------- ----- ---- ---- ---------------------
    COL_ID_1                            FIRST   100           CHARACTER            
      (FILLER FIELD)
    IN_FILE_1                         DERIVED     *  EOF      CHARACTER            
        Static LOBFILE.  Filename is c:\simple.xml
    
    Record 1: Rejected - Error on table TH_XML.
    ORA-00904: "SYS_NC_ROWINFO$": invalid identifier
    
    Record 2: Rejected - Error on table TH_XML.
    ORA-00904: "SYS_NC_ROWINFO$": invalid identifier
    
    Record 3: Rejected - Error on table TH_XML.
    ORA-00904: "SYS_NC_ROWINFO$": invalid identifier
    
    Record 4: Rejected - Error on table TH_XML.
    ORA-00904: "SYS_NC_ROWINFO$": invalid identifier
    
    Record 5: Rejected - Error on table TH_XML.
    ORA-00904: "SYS_NC_ROWINFO$": invalid identifier
    
    Record 6: Rejected - Error on table TH_XML.
    ORA-00904: "SYS_NC_ROWINFO$": invalid identifier
    
    Record 7: Rejected - Error on table TH_XML.
    ORA-00904: "SYS_NC_ROWINFO$": invalid identifier
    
    Record 8: Rejected - Error on table TH_XML.
    ORA-00904: "SYS_NC_ROWINFO$": invalid identifier
    
    Record 9: Rejected - Error on table TH_XML.
    ORA-00904: "SYS_NC_ROWINFO$": invalid identifier
    
    Record 10: Rejected - Error on table TH_XML.
    ORA-00904: "SYS_NC_ROWINFO$": invalid identifier
    
    Record 11: Rejected - Error on table TH_XML.
    ORA-00904: "SYS_NC_ROWINFO$": invalid identifier
    
    Record 12: Rejected - Error on table TH_XML.
    ORA-00904: "SYS_NC_ROWINFO$": invalid identifier
    
    Record 13: Rejected - Error on table TH_XML.
    ORA-00904: "SYS_NC_ROWINFO$": invalid identifier
    
    Record 14: Rejected - Error on table TH_XML.
    ORA-00904: "SYS_NC_ROWINFO$": invalid identifier
    
    Record 15: Rejected - Error on table TH_XML.
    ORA-00904: "SYS_NC_ROWINFO$": invalid identifier
    
    Record 16: Rejected - Error on table TH_XML.
    ORA-00904: "SYS_NC_ROWINFO$": invalid identifier
    
    Record 17: Rejected - Error on table TH_XML.
    ORA-00904: "SYS_NC_ROWINFO$": invalid identifier
    
    Record 18: Rejected - Error on table TH_XML.
    ORA-00904: "SYS_NC_ROWINFO$": invalid identifier
    
    Record 19: Rejected - Error on table TH_XML.
    ORA-00904: "SYS_NC_ROWINFO$": invalid identifier
    
    Record 20: Rejected - Error on table TH_XML.
    ORA-00904: "SYS_NC_ROWINFO$": invalid identifier
    
    Record 21: Rejected - Error on table TH_XML.
    ORA-00904: "SYS_NC_ROWINFO$": invalid identifier
    
    Record 22: Rejected - Error on table TH_XML.
    ORA-00904: "SYS_NC_ROWINFO$": invalid identifier
    
    Record 23: Rejected - Error on table TH_XML.
    ORA-00904: "SYS_NC_ROWINFO$": invalid identifier
    
    
    Table TH_XML:
      0 Rows successfully loaded.
      23 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:                    256 bytes(64 rows)
    Read   buffer bytes: 1048576
    
    Total logical records skipped:          0
    Total logical records read:            23
    Total logical records rejected:        23
    Total logical records discarded:        0
    
    Run began on Tue Jul 24 16:42:25 2012
    Run ended on Tue Jul 24 16:42:26 2012
    
    Elapsed time was:     00:00:00.23
    CPU time was:         00:00:00.05
    I get error ORA-00904: "SYS_NC_ROWINFO$": invalid identifier in the logfile (mentioned above). Could someone help me know where I am doing wrong?

    Thanks in advance.

    Published by: 876991 on 24 July 2012 14:18

    Hello

    This remove the control file:

    XMLTYPE(in_file_1)
    

    It is used only if the target table is an array of XMLType object.

    For an XMLType column LOBFILE is sufficient, for example:

    LOAD DATA
    INFILE *
    APPEND INTO TABLE TH_XML
    (
     col_id_1  CHAR (100),
     in_file_1 LOBFILE(CONSTANT "c:\simple.xml") TERMINATED BY EOF
    )
    begindata
    MYID1
    

    It tells SQL * Loader data consisting of one record with COL_ID_1 = "MYID1" and content = "c:\simple.xml" IN_FILE_1

    SQL> CREATE TABLE TH_XML
      2  (
      3    COL_ID_1   VARCHAR2(100 BYTE),
      4    IN_FILE_1  XMLTYPE
      5  );
    
    Table created.
    
    SQL> host sqlldr control=test.ctl
    Username:dev
    Password:
    
    SQL*Loader: Release 11.2.0.2.0 - Production on Mer. Juil. 25 01:30:46 2012
    
    Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
    
    Commit point reached - logical record count 1
    
    SQL> set long 5000
    SQL> column col_id_1 format a15
    SQL> select * from th_xml;
    
    COL_ID_1        IN_FILE_1
    --------------- --------------------------------------------------------------------------------
    MYID1           
                     
                     
                               Some Author1
                               Some Title1
                               Computer
                               44.95
                               2000-10-01
                               creating applications
                       
                       
                               Some Author2
                               Some Title2
                               Computer
                               49.95
                               2001-04-16
                               Microsoft Visual Studio 7 is explored in depth
                    
     
    
  • query SQL loader

    Hello

    I load a CSV for emp table data using sql loader.
    I wrote the control as file below. How to run so that the data can be inserted into the emp table.

    Control file:
    DOWNLOAD THE DATA
    INFILE ' C:\VINOD\EMP_DATA. CSV'
    INSERT INTO THE TABLE EMP
    FIELDS ENDED BY ',' POSSIBLY FRAMED BY "" "
    TRAILING NULLCOLS
    (ENO, ENAME, SAL);


    Thank you

    910575 wrote:
    Hello

    I load a CSV for emp table data using sql loader.
    I wrote the control as file below. How to run so that the data can be inserted into the emp table.

    Control file:
    DOWNLOAD THE DATA
    INFILE ' C:\VINOD\EMP_DATA. CSV'
    INSERT INTO THE TABLE EMP
    FIELDS ENDED BY ',' POSSIBLY FRAMED BY "" "
    TRAILING NULLCOLS
    (ENO, ENAME, SAL);

    Thank you

    bcm@bcm-laptop:~$ sqlldr 
    
    SQL*Loader: Release 11.2.0.1.0 - Production on Sun Jun 24 11:28:59 2012
    
    Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
    
    Usage: SQLLDR keyword=value [,keyword=value,...]
    
    Valid Keywords:
    
        userid -- ORACLE username/password
       control -- control file name
           log -- log file name
           bad -- bad file name
          data -- data file name
       discard -- discard file name
    discardmax -- number of discards to allow          (Default all)
          skip -- number of logical records to skip    (Default 0)
          load -- number of logical records to load    (Default all)
        errors -- number of errors to allow            (Default 50)
          rows -- number of rows in conventional path bind array or between direct path data saves
                   (Default: Conventional path 64, Direct path all)
      bindsize -- size of conventional path bind array in bytes  (Default 256000)
        silent -- suppress messages during run (header,feedback,errors,discards,partitions)
        direct -- use direct path                      (Default FALSE)
       parfile -- parameter file: name of file that contains parameter specifications
      parallel -- do parallel load                     (Default FALSE)
          file -- file to allocate extents from
    skip_unusable_indexes -- disallow/allow unusable indexes or index partitions  (Default FALSE)
    skip_index_maintenance -- do not maintain indexes, mark affected indexes as unusable  (Default FALSE)
    commit_discontinued -- commit loaded rows when load is discontinued  (Default FALSE)
      readsize -- size of read buffer                  (Default 1048576)
    external_table -- use external table for load; NOT_USED, GENERATE_ONLY, EXECUTE  (Default NOT_USED)
    columnarrayrows -- number of rows for direct path column array  (Default 5000)
    streamsize -- size of direct path stream buffer in bytes  (Default 256000)
    multithreading -- use multithreading in direct path
     resumable -- enable or disable resumable for current session  (Default FALSE)
    resumable_name -- text string to help identify resumable statement
    resumable_timeout -- wait time (in seconds) for RESUMABLE  (Default 7200)
    date_cache -- size (in entries) of date conversion cache  (Default 1000)
    no_index_errors -- abort load on any index errors  (Default FALSE)
    
    PLEASE NOTE: Command-line parameters may be specified either by
    position or by keywords.  An example of the former case is 'sqlldr
    scott/tiger foo'; an example of the latter is 'sqlldr control=foo
    userid=scott/tiger'.  One may specify parameters by position before
    but not after parameters specified by keywords.  For example,
    'sqlldr scott/tiger control=foo logfile=log' is allowed, but
    'sqlldr scott/tiger control=foo log' is not, even though the
    position of the parameter 'log' is correct.
    

    alternative, you could always Read The Fine Manual

    http://docs.Oracle.com/CD/E11882_01/server.112/e22490/part_ldr.htm#i436326

  • SQL * Loader - rejected records - error on table ORA-01722: invalid number

    Get the following errors:

    Please tell me where I'm wrong?
    The log file and extracts the data file with the control file is attached.
    Also guide me please how I can download 4900 files at once?

    -------------------------------------
    SQL * Loader: release 11.1.0.7.0 - Production on Fri 14 Oct 03:06:06 2011

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

    Control file: sample.ctl
    Data file: Cities.csv
    Bad leadership: Cities.bad
    Discard File: none is specified

    (Allow all releases)

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

    Table CITY, loaded from every logical record.
    Insert the option in effect for this table: INSERT

    Column Position Len term Encl. Datatype name
    ------------------------------ ---------- ----- ---- ---- ---------------------
    FIRST ID *, CHARACTER
    35. ACCORDING TO NAME, ' CHARACTER
    COUNTRYCODE 3, ' CHARACTER
    THE NEXT POPULATION * CHARACTER WHT

    Sheet 1: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Sheet 2: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Sheet 3: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Folder 4: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Sheet 5: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Sheet 6: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Sheet 7: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Sheet 8: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    File 9: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Case 10: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Factsheet 11: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Sheet 12: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    File 13: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Fact sheet 14: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Fact sheet 15: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Sheet 16: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    File 17: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Sheet 18: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    File 19: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Sheet 20: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Sheet 21: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Account 22: rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Sheet 23: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record number of 24: rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Sheet 25: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Fact sheet 26: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Fact sheet 27: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record 28: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record 29: rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record 30: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record of 31: rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    • Statement 32: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record 33: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Page 34: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record 35: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record 36: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record 37: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record 38: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Sheet 39: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record 40: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Sheet 41: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Page 42: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record 43: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Sheet 44: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record 45: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    • Statement 46: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record 47: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record 48: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record 49: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Page 50: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record 51: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number


    NUMBER of MAXIMUM ERRORS EXCEEDED - above the statistics reflect partial performance.

    CITY table:
    0 rows successfully loaded.
    51 lines not filled 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: 35840 bytes (64 lines)
    Bytes of read buffer: 1048576

    Total logical records ignored: 0
    Total logical records read: 64
    Total rejected logical records: 51
    Total logical records ignored: 0

    Run started on Fri 14 Oct 03:06:06 2011
    Run finished Fri Oct 14 03:06:12 2011

    Time was: 00:00:06.18
    Time processor was: 00:00:00.03



    ----------------------------------------------------------------------

    my control file (sample.ctl):

    Load data infile 'Cities.csv '.
    in the town of table
    fields completed by «,»
    (external id integer,
    char (35) name box by ' ', '
    CountryCode tank (3) box by ' ', '
    external population integer terminated by '\n '.
    )

    my data (Cities.csv) file (it contains 4900 documents, but I show here just 4 records for ease)

    3830, "Virginia Beach", "USA", 425257
    3831, 'Atlanta', 'USA', 416474
    3832, "Sacramento", "USA", 407018
    3833, 'Oakland', 'USA', 399484


    Thanks in advance!

    Watch when I have a little change your database as follows

    1,'Kabul','AFG',1780000
    2,'Qandahar','AFG','237500'
    3,'Herat','AFG','186800'  
    

    I got the same error (last 2 rows rejected for the same number invalid error)

    mhouri > select * from cities;
    
            ID NAME                                COU POPULATION
    ---------- ----------------------------------- --- ----------
             1 Kabul                               AFG    1780000
    
    SQL*Loader: Release 10.2.0.3.0 - Production on Fri Oct 14 10:38:06 2011
    
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    
    Control File:   cities.ctl
    Data File:      cities.dat
      Bad File:     cities.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 CITIES, loaded from every logical record.
    Insert option in effect for this table: INSERT
    
       Column Name                  Position   Len  Term Encl Datatype
    ------------------------------ ---------- ----- ---- ---- ---------------------
    ID                                  FIRST     *   ,       CHARACTER
    NAME                                 NEXT    35   ,    '  CHARACTER
    COUNTRYCODE                          NEXT     3   ,    '  CHARACTER
    POPULATION                           NEXT     *  WHT      CHARACTER            
    
    Record 4: Rejected - Error on table CITIES, column ID.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 2: Rejected - Error on table CITIES, column POPULATION.
    ORA-01722: invalid number
    
    Record 3: Rejected - Error on table CITIES, column POPULATION.
    ORA-01722: invalid number
    
    Table CITIES:
      1 Row successfully loaded.
      3 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:                  35840 bytes(64 rows)
    Read   buffer bytes: 1048576
    
    Total logical records skipped:          0
    Total logical records read:             4
    Total logical records rejected:         3
    Total logical records discarded:        0
    
    Run began on Fri Oct 14 10:38:06 2011
    Run ended on Fri Oct 14 10:38:06 2011
    
    Elapsed time was:     00:00:00.23
    CPU time was:         00:00:00.09
    

    Value of the population within the data file must be a number

    Best regards

    Mohamed Houri

Maybe you are looking for

  • Extension of memory Tecra T9100

    Memory modules can be installed in Tecra T9100 with PT910E-00DYG-GR part number? I have 256 MB, I can install a module with 512 MB?

  • Satellite A665 - error in the Recovery Media Creator

    Hello world I have a Satellite A665 and I tried to do a recovery with the Recovery Media Creator disc, but I got an error Code: 0E01B5-26 - 2A 030200Anyone has an idea about this problem!

  • Qosmio X 500-driver stopped responding and has successfully recovered

    Display driver stopped responding and has successfully recovered! Is it someone who has this problem on the Qosmio X 500 with NVIDIA GeForce GTS 360 M graphics card?This error has become usual, for me it is 5 to 10 times a day. It happens more often

  • Problem with a keyboard key of T440 after the upgrade to Windows 10

    Hello world I have a Brazilian keyboard layout (ABNT2) on my T440 and I am facing a problem after the upgrade to Windows 10. The new version of Windows recognizes this key: As long as the "CTRL on the right" (commom on other layouts). Everyone was fa

  • DVDplayer did ' t work.

    my dvd did drive ' t work, sometimes engine very n dvd players sometimes readers like ferrari, no meesege errror, it crashes after a few seconds