SQL Loader error for DATE columns

Oracle version: Oracle Database 11g Enterprise Edition Release 11.1.0.7.0

My control file:
LOAD DATA 
INFILE 'D:\Info\new_emp.dat'
BADFILE 'D:\Info\new_emp.bad'
DISCARDFILE 'D:\Info\new_emp.dsc'

INTO TABLE "NEW_EMP"

FIELDS TERMINATED BY ','

  (EMPLOYEE_ID
, 
   EMPLOYEE_FIRSTNAME
, 
   EMPLOYEE_LASTNAME
, 
   EMPLOYEE_ADDRESS
, 
   EMPLOYEE_CITY
, 
   EMPLOYEE_STATE
, 
   EMPLOYEE_ZIP_CODE
, 
   EMPLOYEE_COUNTRY
, 
   EMPLOYEE_PHONE_NMBR
, 
   EMPLOYEE_FAX_NMBR
, 
   EMPLOYEE_EMAIL
, 
   EMPLOYEE_GENDER
, 
   EMPLOYEE_AGE
, 
   NATIVE_LANG_DESC
, 
   SEC_LANG_DESC
, 
   TER_LANG_DESC
, 
   POSITION_TYPE
, 
   REGIONAL_MANAGER
, 
   DEALERSHIP_ID
, 
   DEALERSHIP_MANAGER_FIRSTNAME
, 
   DEALERSHIP_MANAGER_LASTNAME
, 
   HIRE_DATE
)
The table I want to insert is called NEW_EMP. His last HIRE_DATE column is the DATE data type.

Here are my dat file:
1201,Andrew,Arthurs,200 Monroe street,Naperville,IL,,,1111111111,,,M,34,,,,Manager,,11,Harold,King,11/29/2003 13:40:00
From the command prompt, I get:
sqlldr username/password@db control=control.ctl
The error generated in the log file is:
Record 1: Rejected - Error on table "NEW_EMP", column HIRE_DATE.
ORA-01843: not a valid month
What can I change here in order to insert correctly the dates?

Try this

LOAD DATA
INFILE 'D:\Info\new_emp.dat'
BADFILE 'D:\Info\new_emp.bad'
DISCARDFILE 'D:\Info\new_emp.dsc'

INTO TABLE "NEW_EMP"

FIELDS TERMINATED BY ','

  (EMPLOYEE_ID
,
   EMPLOYEE_FIRSTNAME
,
   EMPLOYEE_LASTNAME
,
   EMPLOYEE_ADDRESS
,
   EMPLOYEE_CITY
,
   EMPLOYEE_STATE
,
   EMPLOYEE_ZIP_CODE
,
   EMPLOYEE_COUNTRY
,
   EMPLOYEE_PHONE_NMBR
,
   EMPLOYEE_FAX_NMBR
,
   EMPLOYEE_EMAIL
,
   EMPLOYEE_GENDER
,
   EMPLOYEE_AGE
,
   NATIVE_LANG_DESC
,
   SEC_LANG_DESC
,
   TER_LANG_DESC
,
   POSITION_TYPE
,
   REGIONAL_MANAGER
,
   DEALERSHIP_ID
,
   DEALERSHIP_MANAGER_FIRSTNAME
,
   DEALERSHIP_MANAGER_LASTNAME
,
   HIRE_DATE Date "mm/dd/yyyy hh24:mi:ss"
)

p.s: not tested

Concerning

REDA

Tags: Database

Similar Questions

  • [nQSError: 43119]:-the data type: 25 is not supported columns error for data type "uniqueidentifier".

    Hi all


    I am facing a problem while creating a BI reports to the SQL Server 2008 Database.

    Access to columns of data type "uniqueidentifier" I get error [nQSError: 43119]:-the data type: 25 is not supported.

    • OBIEE 11.1.1.6.11 on Linux x86_64 servers is hosted by the Services of Oracle Cloud.
    • Using last "ODBC driver for SQL server 11" for connection (also tried driver "DataDirect SQL Server 6.0 native Wire Protocol").
    • No "Uniqueidentifier" data type columns display correctly in reports.
    • I tried to change the columns of data type "Uniqueidentifier" to char (36), VARCHAR (36), VARCHAR (40), types of binary data (16) in the physical layer on various suggestions but error still there.

    Same columns questioned the SQL Developer (using third-party jTDS JDBC driver "jtds - 1.2.7 - dist") I am able to see these "uniqueidentifier" data columns. record sample:-"CB350576-FCD8-DE11-B111-002219598619".


    Please advice if this is a bug or I'm missing some property of SQL server database settings.


    Thanks in advance.

    Yes Srini,

    This type of column becomes UNKNOWN when they are imported into SPR but its strange after changing to VARCHAR (36), we can use it for joining tables without any problem.

    Only issue I'm facing now is the limitation to use in queries like calculate the total number of incidents (in my case incidentid is the primary key).

    But I've found a workaround. I am formulating a measure in MDB layer to get the number of total incidents as {CASE WHEN is NULL then 0 otherwise 1 END}.  the aggregation is defined on the sum and I get incident count works correctly.

    Thanks for your help.

  • SQL Loader error - reduced to bare bones

    I get the same error repeatedly when you try to use Sql Loader. So I reduced my load to a single record of test with 2 columns of text.



    The data file is "C:\data_dir\opps_test.csv" and simply looks like this:
    t | t



    Here is the control file:

    load data
    INFILE 'C:\data_dir\opps_test.csv '.
    in the opps_test table
    fields ended by ' |'
    (OPP_ID, CAMP_CODE)



    And here is a desc on the target table opps_test:

    OPP_ID VARCHAR2 (255)
    CAMP_CODE VARCHAR2 (255)



    When I run sql loader I get the following error on the screen and in my journal and I wonder if anyone has any idea what it really means. The data consists of just me typing t | t and save the csv file


    SQL * Loader: release 10.2.0.3.0 - Production Saturday, May 9, 22:12:19 2009

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

    SQL * Loader-350: at line 1 syntax error.
    Illegal combination of nonalphanumeric characters
    {\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fcharset
    ^


    Thank you

    Published by: John W on May 9, 2009 22:31

    Your control file works for me just as you posted.

    Just a hunch...

    SQL*Loader-350: Syntax error at line 1.
    Illegal combination of non-alphanumeric characters
    {\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fcharset
    

    You save your control file or the data file with Microsoft Word or something other than a text editor?

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

  • [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".

  • APEX_UTIL. IR_FILTER with BETWEEN operator for date columns

    Hello

    When I run my application, I can put a filter BETWEEN date columns. I can't find a way to use it with the APEX_UTIL. Function IR_FILTER. Maybe I missed something?
    Documentation: http://download.oracle.com/docs/cd/E17556_01/doc/apirefs.40/e15519/apex_util.htm#CHDDDFBF

    Tobias

    Tobias,

    If you think about it, "between the" is nothing else than a way of the single line to say

    WHERE: X > =: Y
    AND: X<=>

    Then you should be able to apply two filters of the report using the operators LTE and GTE

    Hope this helps

    Doug Gault
    www.sumneva.com

  • Timestamp for date columns data type are not imported in discoverer admin

    Hi all
    Someone you will suggest why timestamp data type columns are not imported into admin. discoverer other types of data import you correctly, but the timestamp data type columns are missed.

    Please let me know to change the type of data is not possible at this time.
    Thank you

    Hello
    You will be disappointed because the timestamp columns are not one of the recognized data types supported by the discoverer. He acknowledges only dates, strings and (integer and decimal) numbers.

    Maybe you could put up a view that matches the table you use, convert the timestamp in a rather ordinary date?

    Then, inside your end-user license, all you would have to do is redirect the folder to view.

    Best wishes
    Michael

  • How to handle multiple formats of date to the same date field in SQL * Loader

    Dear all,

    I have a requirement where I need to get data from a text file and even insert into the oracle table.

    I'm using SQL * Loader to fill data from the text file in my table.

    The file has an area where I expect to date data date in different formats, such as MON/dd/yyyy mon/dd/yyyy mon/dd/yyyy, dd/mm/yyyy, DD/month/yyyy.

    When you use SQL * Loader, I can see loading fails for records where we have formats such as LUN/jj/aaaa, Mon/dd/yyyy, DD/month/yyyy.

    Is it possible in SQL * Loader where we can mention all these date formats so that data from that date should go smoothly in the underlying date column in the table.

    Receive your answer on that.

    Thank you
    Madhu K.

    I think following could be the solution to your problem:

    Suppose if you have data from four different date formats, you need to load the data into four different tables by running SQL * Loader four times and each time specify other date format in the control file whose data to load, and then at the end, merge data from these four different tables using the UNION clause.

    Elya

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

  • Problem with Sql Loader

    Hi s/n,.

    I am facing problems when loading the dates in the database by using sql loader. My data file can have several date formats, so I have a function that interprets date and removes the time settings and the date of return.

    Something like that.

    For example:

    I have a table-

    CREATE TABLE TEMP1234

    (

    IDENTIFICATION NUMBER,

    DATE OF ASOF_DATE

    );

    Data file

    10001172 | 09/12/1945

    Control file:

    OPTIONS (DIRECT = TRUE, SILENT (FEEDBACK) =, skip = 0)

    DATA RELATING TO SUNK COSTS

    REPLACE

    in the temp1234 table

    ' fields completed by "|" possibly provided by ' "'

    TRAILING NULLCOLS

    (ID,

    ASOF_DATE "decode (: ASOF_DATE, null,:ASOF_DATE,conv_date1(:ASOF_DATE))).

    )

    Function CONV_DATE1:

    FUNCTION to CREATE or REPLACE conv_date1 (p_str IN VARCHAR2)
    DATE OF RETURN
    IS
    RETURN_VALUE DATE;

    p_str1 VARCHAR2 (15): = NULL;

    FmtArray TYPE IS a TABLE OF VARCHAR2 (30);

    g_fmts fmtArray
    : = fmtArray ("yyyy-mm-dd",
    "yyyy/mm/dd"
    mm/dd/yyyy"."
    "dd-mm-yyyy",
    "dd/mm/yyyy",
    "mm-dd-yyyy");
    BEGIN
    p_str1: = SUBSTR (p_str, 1, 10);

    BECAUSE me in 1... g_fmts. COUNTY
    LOOP
    BEGIN
    return_value: = TO_DATE (p_str1, g_fmts (i));
    EXIT;
    EXCEPTION
    WHILE OTHERS
    THEN
    NULL;
    END;
    END LOOP;

    IF (return_value IS NULL)
    THEN
    RAISE PROGRAM_ERROR;
    END IF;

    RETURN Return_value;
    END;
    /

    In this case, if the year in the data file shown in 1945, date which is load in the poster 2045 database.

    But when I run this function by putting a sql editor - it returns the correct value.

    Select double conv_date1('12/09/1945');

    Please help me understand what is causing the problem.

    I think there may be an implicit conversion going on with the combination of decode and checking nvl and function within SQL * Loader.  I put the nvl checking in function and simply use the function in the control file, as shown below.

    OPTIONS (DIRECT = TRUE, SILENT (FEEDBACK) =, skip = 0)

    DATA RELATING TO SUNK COSTS

    REPLACE

    in the temp1234 table

    ' fields completed by "|" possibly provided by ' "'

    TRAILING NULLCOLS

    (ID,

    asof_date ' conv_date1 (: asof_date).

    )

    FUNCTION to CREATE or REPLACE conv_date1 (p_str IN VARCHAR2)

    DATE OF RETURN

    IS

    RETURN_VALUE DATE;

    p_str1 VARCHAR2 (15): = NULL;

    FmtArray TYPE IS a TABLE OF VARCHAR2 (30);

    g_fmts fmtArray

    : = fmtArray ("yyyy-mm-dd",

    "yyyy/mm/dd"

    mm/dd/yyyy"."

    "dd-mm-yyyy",

    "dd/mm/yyyy",

    "mm-dd-yyyy");

    BEGIN

    IF p_str IS NULL

    THEN RETURN NULL;

    ON THE OTHER

    p_str1: = SUBSTR (p_str, 1, 10);

    BECAUSE me in 1... g_fmts. COUNTY

    LOOP

    BEGIN

    return_value: = TO_DATE (p_str1, g_fmts (i));

    EXIT;

    EXCEPTION

    WHILE OTHERS

    THEN

    NULL;

    END;

    END LOOP;

    IF (return_value IS NULL)

    THEN

    RAISE PROGRAM_ERROR;

    END IF;

    RETURN Return_value;

    END IF;

    END;

    /

  • 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

  • Export to SQL Loader?

    Is it possible to export a data table (using the filter) to a flat file using the SQL * loader? If so, how?

    -Thank you

    SQL * Loader is for 'loading' data, 'record' not data.
    You can use the export to command line utility, or if it's specific data and/or required specific format, you can use UTL_FILE to write flat files or binary data.

  • something about sql loader

    Jin

    I want to load a txt file into a database table
    the contents of this file as txt

    a 15 123 k tt
    a 15 223 k tt
    a k 323 105 tt
    a 15 423 k tt
    ...

    I want to delimit each record in four fields by blanks
    but I don't want all these four fields loaded into the table,
    Instead, I want to just choose only two useful fields (for example, the second and third field) in a table with only two columns

    How do I make.

    also, I tried the toad sql * loader wizard, I map columns in the corresponding field in the field, mapping, but this does not work, can someone tell me why? can it work?

    Thank you.

    online waiting for your answer

    sqlldr

    use the FILL in the control file

  • On the use of SQL * loader program pl/sql command

    Is it possible to develop a PL/SQL program that calls SQL * Loader (sqlldr userid =...) command?

    We want to package a process that loads data from a text file into a table, and we research it is possible to use SQL * Loader to the data loading process.

    You can launch sqlldr like all other orders of operation. There are several methods of cooking OS command, as

    1. external procedure PL/SQL: CHMOD FROM A PLSQL?

    Johan's blog: how to call PL/SQL kernel32.dll.

    2 Java Stored Procedure: Blog of Johan: using JAVA in PL/SQL - PART - I list files with timestamp , Blog of Johan: using JAVA in PL/SQL - PART - II operating system information obtaining

    3. external PREPROCESSOR Table function: no response on java not call windows in oracle command

    Johan's blog: list uses of disk operating system with external feature of the Oracle PREPROCESSOR Table

    Johan's blog: operating system from the list of files with external feature of the Oracle PREPROCESSOR Table

    4. using DBMS_SCHEDULER,job_type => 'executable' and job_action  => '/bin/sh' (may be)

  • Guests of the date to a Date column

    Hi gurus,
    I'm trying to get the Date of application for a Date column. This is the approach that I took from the previous post.

    Re: How to get the date of request for a date column

    My approach
    (1) in the report, I put the filter on the Date column with variable presentation as startdate with a date by default, and in the window of fx, I applied
    CASES WHERE 1 = 0 THEN the picture. Table of date ELSE. END date
    (2) I repeated the same thing by getting the same column with Variable presentation date as Enddate with a date by default and in the fx I applied
    CASES WHERE 1 = 1 THEN table. Table of date ELSE. END date
    (3) in the dash prompt, I had the same date twice column by applying the same formulas in fx, default sysdate - variable Server - and variable adjustment Set - variable of presentation - startdate and same with Enddate.

    The report works well, but the report does not all records. I mean that I have given 12:04:36 am but report draws from 12:37:53 am. So, I'm missing some documents. I don't know where I am doing mistake.

    Could someone help me please

    Thank you

    Published by: 792011 on September 14, 2011 11:00

    792011 wrote:
    Hi gurus,
    I'm trying to get the Date of application for a Date column. This is the approach that I took from the previous post.

    Re: How to get the date of request for a date column

    My approach
    (1) in the report, I put the filter on the Date column with variable presentation as startdate with a date by default, and in the window of fx, I applied
    CASES WHERE 1 = 0 THEN the picture. Table of date ELSE. END date
    (2) I repeated the same thing by getting the same column with Variable presentation date as Enddate with a date by default and in the fx I applied
    CASES WHERE 1 = 1 THEN table. Table of date ELSE. END date
    (3) in the dash prompt, I had the same date twice column by applying the same formulas in fx, default sysdate - variable Server - and variable adjustment Set - variable of presentation - startdate and same with Enddate.

    The report works well, but the report does not all records. I mean that I have given 12:04:36 am but report draws from 12:37:53 am. So, I'm missing some documents. I don't know where I am doing mistake.

    Could someone help me please

    Thank you

    Published by: 792011 on September 14, 2011 11:00

    From what you say, as you did, it should not work. Investigation of the CASE, you have stage 1) and (2) that you put in the window fx in two columns, is indeed the same thing that just have two instances of your table. Date column.

    Follow the steps in this link and you should be good to go:

    http://oraclebizint.WordPress.com/2008/02/26/Oracle-BI-EE-101332-between-prompts-for-date-columns-using-presentation-variables/

Maybe you are looking for

  • Impossible to move photos from the iMac to iPhone6

    I understand that the normal way to move photos from an iMac to an iPhone is to do it via iTunes. The problem I encounter is that there isn't a registration under devices in my iPhone Photos in iTunes 6. I use 12.4.2.4 and iPhone iTunes 6, worm 9.3.2

  • Unable to play or download a recently purchased song

    I bought a song on my iPhone 6s and I could play for a week.  After that, he would still show on my reading list, but it would be directly.  I deleted the song from my iPhone and tried to redownload it but impossible.  Even went to the ITunes store o

  • How can I change the formats for left and right pages?

    First timer here in the Apple community so forgive my mistakes. Works with Apple Pages 5.6.1 on a MacBook Air, try to format a book for automatic printing. I want to do different for left and right pages headers and footers, and margins so that, for

  • Operating system preinstalled on all new Satellite C850 - 14 c is in Finnish

    It is a strange problem. My brother has recently ordered a new laptop C850 - 14 c and it arrived by mail direct from the warehouse. When it out of the box, she had a UK Plug and a UK keyboard (we are in England), but when it was starting up it was al

  • PROTECTED Z930 Power adapter, flashing

    The power adapter light flashes in orange and I can't turn on my laptop. It seems to blink 7 times and then 1 time before a long pause. Any ideas on how to get the laptop on again?