the year must be between-4713 and 9999... wellllll... it is!

I'm using SQL * Loader in Oracle 11.2.0.1. I am really puzzled why some files (of thousands) in my. Produce CSV files:

Sheet 5: Rejected - error on the table IMPORT_PLAYERS, BIRTHDATE column.
ORA-01841: (full) year must be between-4713 and 9999 and not 0

Accounts really made the impression that they are the same as all the rest.

The controlfile is quite simple:

load data
INFILE ' / tmp/test/test.csv'
in the import_players table
fields ended by ',' optionally surrounded "" "
TRAILING NULLCOLS
(player_id, tank,
char name,
last_name char,
tank position,
whole first_season
whole last_season
whole h_feet
h_inches float,
integer weight,
college tank,
Date of birth DATE "YYYY-MM-DD HH24:MI:SS")

Here is a sample of the. CSV, which has two records of 'bad' - I have bolded the records that cause problems:

BAILETO01, Toby Bailey, G, 1998, 1999, 6, 6, 213, University of California - Los Angeles, 1975-11-19 00:00:00
Jimmie Baker, BAKERJI01, F, 1975, 1975, 6, 9, 220, University of Hawaii, 1953-12-25 00:00:00
BAKERMA01, Mark, Baker, G, 1998, 1998, 6, 1, 175, Ohio State University, 1969-11-11 00:00:00
BAKERNO01, Norm, Baker, g., 1946, 1946, 6, 0, 180, 1923-02-17 00:00:00
* BAKERVI01, wine, Baker, F, 1993, 2005, 6, 10.5, 232, University of Hartford, 1971-11-23 00:00:00 *.
BAKERMA02, Maurice, Baker, g., 2004, 2004, 6, 1, 175, Oklahoma State University, 1979-07-28 00:00:00
BalkmRe01 Renaldo Balkman, F, 2006, 2009, 6, 8, 208, University of North Carolina, 1984-07-14 00:00:00
BALLCE01, Cedric, ball, F, 1990, 1990, 6, 8, 210, University of North Carolina at Charlotte, 1968-04-16 00:00:00
BALLAGR01, Greg, Ballard, F, 1977, 1988, 6, 7, 215, University of Oregon, 1955-01-29 00:00:00
BELLRA01, Bell, Raja, g., 2000, 2009, 6, 5, 215, Florida International University, 1976-09-19 00:00:00
BELLWI01, William, Bell, G, 1959, 1960, 6, 0, 180, North Carolina State University, 1932-09-13 00:00:00
* BELLAWA01, Walt, Bellamy, c., 1961, 1974, 6, 10.5, 225, Indiana University, 1939-07-24 00:00:00 *.
IRV, Bemoras, BEMORIR01, f., 1953, 1956, 3, 6, 185, University of Illinois, 1930-11-18 00:00:00
BENBOLE01, Leon, Benbow G, 1974, 1975, 6, 4, 185, Jacksonville University, 1950-07-23 00:00:00

I don't really see what's the difference between these and other documents. DATE formats look good and adjust the format of the image that I gave. No special characters - I even copy and paste these files into a new file and I still have this strange error.

Tried to change the format of DD-MM-RRRR, but it made no difference.

The DDL table is:

create table import_players)
player_id varchar2 (15).
first name varchar2 (30),
VARCHAR2 (30) last_name,.
position tank (1),
whole first_season
whole last_season
whole h_feet
h_inches float,
integer weight,
College varchar2 (50).
Date of birth
);

I'm sure it's something very obvious but... I hit my head for a while now and can't see the problem. Any ideas?

Hello raindog.
By specifying the data type of the float in the file control prevents the decimal is interpreted correctly. By removing the data type and therefore have SQL * Loader present Oracle a string instead of a float, Oracle will then force a data conversion and data will load. I would like a little further to determine how to use the type of data in the control file so that Oracle is provided the already converted value research.

Hope this helps,
Luke

Tags: Database

Similar Questions

  • Help on the ORA-01841: (full) year must be between-4713 and 9999 and not

    While in the console f? p = 4050 connected in internal/admin in Home-> manage workspaces-> manage developers and users
    Download "ORA-01841: (full) year must be between-4713 and 9999 and not 0" when you try to change a user.
    Unable to reset the password or modify an admin user.
    This just started 2 weeks ago.


    Using Application Express 4.0.2.00.06.

    Someone has seen this.

    I heard of a problem due to a problem with the PASSWORD_LIFE_TIME. Worth giving a try:

    Solution
    The apex_admin app, navigate to home > Service Management > security then enter integer values for:

    -Lifetime account password (days) - enter 11688, for example
    -Apply the changes.

  • Error: ORA-01841: (full) year must be between-4713 and 9999 and not 0

    Hi - I get error ORA-01841 ((full) year must be between-4713 and 9999 and not 0) because of the following line in my where clause:

    AND p_run_date < ((add_months (ip. insured_plan_termination_date,,13) nvl), to_date (31-DEC-9999. ' ' DD-MON-YYYY '))

    I look and what I read speaks not to compare the strings that contain dates, but that is not the case here.   p_run_date is without a doubt a date.  I've hardcoded even on a specific date, and I still get the error.

    Any help is greatly appreciated.

    Thank you

    Christine

    Hi, Christine.

    What is insured_plan_termination_date when you get the error?  If it's December, 9998 or later version, you cannot add 13 months, which would put the year beyond 9999, everything as the error message said.

    You said p_run_date is without a doubt one DATE, but what about insured_plan_termination_date?

    It would really help if you could post a test script complete (including CREATE TABLE and INSERT and your complete query instructions) so that people can recreate the problem and test their ideas.

    Check out the Forum FAQ: Re: 2. How can I ask a question on the forums?

  • ORA-01841: (full) year must be between-4713 and 9999 and not 0

    I get the error when I run the following. ORA-01841: (full) year must be between-4713 and 9999 and not 0

    Fiscal_Year = 2011

    When I run the query.

    Select * from gl
    where gl_date > = to_date ('01 - SEP-|) FISCAL_YEAR-1 "," MON-DD-YYYY")
    AND gl_date < = to_date (31 - AUG-|) FISCAL_YEAR', 'DD-MON-YYYY')

    Gl_date is of date data type

    Published by: 893185 on April 6, 2012 11:04

    Published by: 893185 on April 6, 2012 11:04

    893185 wrote:
    It gives invalid number

    The operators | and - have the same priority level, if

    SELECT *
    FROM   gl
    WHERE  gl_date >= TO_DATE ( '01-SEP-' || (fiscal_year - 1), 'DD-MON-YYYY')
           AND gl_date <= TO_DATE ( '31-AUG-' || fiscal_year, 'DD-MON-YYYY');
    

    Concerning
    Peter

  • ORA-01841 year must fall between-4713 and 9999

    Hello

    I try to make simple plsql function and I get this error.

    create or replace function biorytmy (d_urodzenia varchar)

    Return number

    is

    number of v_ile_dni;

    BEGIN

    Select to_number (sysdate - (to_date ('d_urodzenia', ' yyyy/mm/dd'))) in the double v_ile_dni;

    Return v_ile_dni;

    END;

    /

    Any suggestions?

    Paul

    Hello

    2877737 wrote:

    Thx for ansers, then how I can insert the number of days variable and use it as number later?

    Paul

    Have you seen answer #2 above?

    If you want that the function always returns an integer, use TRUNC (SYSDATE) instead of SYSDATE.

    You can use a function like this in an INSERT statement.  If you have trouble, after the INSERT statement.

  • There is a problem, I met when I was used to import 'date' datatype sqlldr: ORA-01841: (full) year must be between-4713 and 9999 and not 0

    control the file as follows:

    load data

    INFILE *.

    insert into table test1

    Fields ended by ',' optionally surrounded "" "

    (id, time_date ' to_date (: time_date, "YYYY-MM-DD HH24:MI:SS)")

    begindata

    "1," 2007-07-18 00:00:00.

    2, "2017-07-18 00:00:00"

    the structure of the table:

    create table test1 (int id, date time_date);

    I'm waiting for your ansers!

    Hello

    seems to be a problem with your file, check on Notepad, the value of the column was enclosed in double quote not 2 times the apostrophe...

    load data

    INFILE *.

    insert into table test1

    Fields ended by ',' optionally surrounded "" "

    (id, time_date ' to_date (: time_date, "YYYY-MM-DD HH24:MI:SS)")

    begindata

    1, "2007-07-18 00:00:00.

    2, "2017-07-18 00:00:00.

    HTH

  • ORA-01847: day of the month must be between 1 and the last day of the month

    Hi all






    Select
    To_date(mDate||) e '|| mtime, "YYYY-MM-DD HH24MISS") meddate
    of PR_MOCTEST_TEMP

    mDate IS OF TYPE of DATA VARCHAR2 AND mtime OF VARCHAR2

    mDate: 07-09-2009
    mtime: 131241

    mDate IS IN FORMAT DD-MONTH-YYYY
    mtime: HHMMS

    mtimeOF IS OF TYPE of DATA VARCHAR2 AND VARCHAR2 mDate

    mDate: 07-09-2009
    mTIME: 131241

    mDATE IS IN FORMAT DD-MONTH-YYYY
    mTIME: HHMMS

    I NEED TO COMBINE THE 2 COLUMNS TO GET THE OUTPUT AS DD-MM-YYYY HH24MISS
    AND I AM GETTING THE ERROR;


    ORA-01847: day of the month must be between 1 and the last day of the month

    where mistaken?

    Please notify


    Kai

    You will find the bad dates using a table of logging of errors:

    --we'll try to insert into here, invalid dates will be thrown out
    create table dst(d date);
    
    -- create an error log table dst_err
    exec dbms_errlog.create_error_log('dst', 'dst_err');
    
    -- try the insert. Will fail with your ORA-01847
    insert into dst select TO_DATE(mdate||' '||mtime,'DD-MM-YYYY HH24MISS') from PR_MOCTEST_TEMP log errors into dst_err('comment'); 
    
    -- view the errors
    select * from dst_err;
    
  • ORA-01841 together of the year must be between... .error in order of

    Hi all
     i have this query with me ,when order by clause is included ,when it is removed ,i see the output with  so  many record counts
    SELECT   porh.segment1,
             CASE
                WHEN popr.action_code = 'APPROVE'
                AND prall.full_name <> 'Sudheer T. Paraputhra'
                AND grdpr.short_name < 'PS-10'
                   THEN prall.full_name
             END directman_pr,-----getting names of managers who perform PR approve action
             porh.description, porl.line_num,
             CASE
                WHEN popr.action_code = 'APPROVE'
                AND prall.full_name <> 'Sudheer T. Paraputhra'
                AND grdpr.short_name < 'PS-10'
                AND poph.action_code = 'SUBMIT'
                   THEN TO_NUMBER (  TO_CHAR (  TO_DATE ('1', 'J')
                                              + (  poph.action_date
                                                 - popr.action_date
                                                ),
                                              'J'
                                             )
                                   - 1
                                  )
             END days_pr,------------------------------(calculating days from PR approval by manager to PO submit by user)
             poha.segment1 po_num, prall.full_name pr_approved_by,
             popr.action_date pr_approved_date,
             CASE
                WHEN poall_apprv.full_name <> 'Sudheer T. Paraputhra'
                AND grdpo_apprv.short_name < 'PS-10'
                AND poph_apprv.action_code = 'APPROVE'
                AND poph.action_code = 'SUBMIT'
                   THEN TO_NUMBER (  TO_CHAR (  TO_DATE ('1', 'J')
                                              + (  poph_apprv.action_date
                                                 - poph.action_date
                                                ),
                                              'J'
                                             )
                                   - 1
                                  )
             END days_po,------calculating days  from PO submit action by user to PO approve action by managers
             popr.sequence_num pr_seq, popr.action_code pr_action,
             poall.full_name po_approved_by, poph.action_date po_approved_date,
             poph.sequence_num po_seq, poph.action_code po_action,
             poph_apprv.action_date po_approved_date_appr,
             poph_apprv.action_code apprv_action_code
        FROM po_requisition_headers_all porh,
             po_requisition_lines_all porl,
             po_req_distributions_all prda,
             po_distributions_all poda,
             po_headers_all poha,
             po_action_history popr,
             po_action_history poph,
             hr.per_all_people_f poall,
             hr.per_all_people_f prall,
             hr.per_all_assignments_f asgpo,
             hr.per_all_assignments_f asgpr,
             per_grades_vl grdpo,
             per_grades_vl grdpr,
             po_headers_all poha_apprv,
             po_distributions_all poda_apprv,
             po_action_history poph_apprv,
             hr.per_all_people_f poall_apprv,
             hr.per_all_assignments_f asgpo_apprv,
             per_grades_vl grdpo_apprv
       WHERE poph.employee_id = poall.person_id
         AND popr.employee_id = prall.person_id
         AND poall.person_id = asgpo.person_id
         AND prall.person_id = asgpr.person_id
         AND asgpr.grade_id = grdpr.grade_id(+)
         AND asgpo.grade_id = grdpo.grade_id(+)
         AND prda.distribution_id = poda.req_distribution_id
         AND poha.po_header_id = poda.po_header_id
         AND prda.requisition_line_id = porl.requisition_line_id
         AND porh.requisition_header_id = porl.requisition_header_id
         AND porh.requisition_header_id = popr.object_id
         AND poph.object_type_code = 'PO'
         AND poha.po_header_id = poph.object_id
         AND SYSDATE BETWEEN poall.effective_start_date AND poall.effective_end_date
         AND SYSDATE BETWEEN prall.effective_start_date AND prall.effective_end_date
         AND SYSDATE BETWEEN asgpo.effective_start_date AND asgpo.effective_end_date
         AND SYSDATE BETWEEN asgpr.effective_start_date AND asgpr.effective_end_date
         AND SYSDATE BETWEEN poall_apprv.effective_start_date
                         AND poall_apprv.effective_end_date
         AND SYSDATE BETWEEN asgpo_apprv.effective_start_date
                         AND asgpo_apprv.effective_end_date
         AND prda.distribution_id = poda_apprv.req_distribution_id
         AND poha_apprv.po_header_id = poda_apprv.po_header_id
         AND poph_apprv.employee_id = poall_apprv.person_id
         AND poall_apprv.person_id = asgpo_apprv.person_id
         AND asgpo_apprv.grade_id = grdpo_apprv.grade_id(+)
         AND poha_apprv.po_header_id = poph_apprv.object_id
         AND poph_apprv.object_type_code = 'PO'
         AND poph_apprv.action_code = 'APPROVE'
    ORDER BY 4, 10, 14
    the calcuation works very well except what order by clause is included
    kindly help

    Published by: makdutakdu on June 1st, 2010 14:51

    makdutakdu wrote:
    Hello

    can u please help me with another query just to calculate the number of days for days_po and pr

    Subtract one DAY from another, this will give you the difference in number of days.

    SQL> select sysdate
      2        - to_date ('01-04-2010', 'dd-mm-yyyy')
      3    from dual
      4  /
    
    SYSDATE-TO_DATE('01-04-2010','
    ------------------------------
                  62,4078240740741
    

    Remember, however, that the time is always part of a DATE.

  • error when reading flat file of external table... "ORA-01849: time must be between 1 and 12"

    My question is - is it possible for me to fix this error at the level of external table definition? Please advice

    Here is the data file I am trying to download...

    KSEA | 08-10 - 2015-17.00.00 | 83.000000 | 32.000000 | 5.800000

    KBFI | 2015-08-06 - 15.00.00 | 78.000000 | 35.000000 | 0.000000

    KSEA | 08-10 - 2015-11.00.00 | 73.000000 | 55.000000 | 5.800000

    KSEA | 08-08 - 2015-05.00.00 | 61.000000 | 90.000000 | 5.800000

    KBFI | 2015-08-06 - 16.00.00 | 78.000000 | 36.000000 | 5.800000

    KSEA | 2015-08-07 - 18.00.00 | 82.000000 | 31.000000 | 10.400000

    KSEA | 08-10 - 2015-00.00.00 | 65.000000 | 61.000000 | 4.600000

    KBFI | 08-08 - 2015-07.00.00 | 63.000000 | 84.000000 | 4.600000

    KSEA | 08-10 - 2015-15.00.00 | 81.000000 | 34.000000 | 8.100000

    This is the external table script

    CREATE TABLE MWATCH. MWATCH. WEATHER_EXT ".

    (

    LOCATION_SAN VARCHAR2 (120 BYTE),

    DATE OF WEATHER_DATETIME,

    NUMBER (16) TEMP.

    NUMBER (16) OF MOISTURE,

    WIND_SPEED NUMBER (16)

    )

    EXTERNAL ORGANIZATION

    (TYPE ORACLE_LOADER

    THE DEFAULT DIRECTORY METERWATCH

    ACCESS SETTINGS

    (records delimited by newline

    BadFile "METERWATCH": "weather_bad" logfile 'METERWATCH': 'weather_log '.

    fields ended by ' |' missing field values are null

    (location_san, WEATHER_DATETIME char date_format DATE mask "YYYY-mm-dd - hh.mi.ss", TEMPERATURE, MOISTURE, wind_speed)

    )

    LOCATION (METERWATCH: 'weather.dat')

    )

    REJECT LIMIT UNLIMITED

    PARALLEL (DEGREE 5 1 INSTANCES)

    NOMONITORING;

    Here is the error in the weather_bad which is generated files...

    column WEATHER_DATETIME of 55 error processing in the 1st row to the /export/home/camsdocd/meterwatch/weather.dat data file
    ORA - 01849ther_log.log 55 56 error processing column WEATHER_DATETIME in the row 1 for the /export/home/camsdocd/meterwatch/weather.dat data file
    5756 ORA - 01849ther_log.log: time must be between 1 and 12
    58column WEATHER_DATETIME 57 error during treatment number 2 for the /export/home/camsdocd/meterwatch/weather.dat data file
    59ORA-58 01849: time must be between 1 and 12
    60column WEATHER_DATETIME of 59 error processing 5th for the /export/home/camsdocd/meterwatch/weather.dat data file
    61ORA-60 01849: time must be between 1 and 12
    62column WEATHER_DATETIME of 61 error treatment in line 6 to the /export/home/camsdocd/meterwatch/weather.dat data file
    63ORA-62 01849: time must be between 1 and 12
    64column WEATHER_DATETIME of 63 error treatment in row 7 for datafile /export/home/camsdocd/meterwatch/weather.dat
    65ORA-64 01849: time must be between 1 and 12
    66column WEATHER_DATETIME of 65 error treatment 9 for the /export/home/camsdocd/meterwatch/weather.dat data file online
    67: time must be between 1 and 12

    My question is - is it possible for me to fix this error at the level of external table definition? Please advice

    Yes it is possible.  Let's not your date mask.  You're masking for 12-hour format when your data is in 24-hour format.  Change the mask of your date to be "YYYY-mm-dd-hh24. MI.ss ".  Notice the change in "BOLD".

  • ORA-01850: time must be between 0 and 23

    Hi techies,.

    We have created a procedure for our daily report.its works well for both location.when we run to a location, we end up with this error.our current NLS_DATE_FORMAT is HH24:MI:SS.but its run successfully when we value nls_date_format = .attendu 'DD-MON-YY' other two (which is the same except for one table where it retrieve data via dblink) is to run correctly with NLS_DATE_FORMAT HH24 : MI: SS.


    ORA-01850: time must be between 0 and 23
    ORA-02063: preceding the line of DW_TO_DIRC. NACALOGISTICS.COM
    ORA-06512: at "OTSLGWEB. DAILY_JOB_PROFIT_REPORT_USA", line 89
    ORA-06512: at line 1

    Sameer_appsdba wrote:
    3. can we add ' alter session set NLS_DATE_FORMAT = 'DD-MON-YY' inside the procedure?

    Yes

    SQL> ed
    Wrote file afiedt.buf
    
      1  create or replace procedure p1_nls as
      2  dt date;
      3  begin
      4  execute immediate('alter session set nls_date_format = ''DD-MON-YYYY''');
      5  select sysdate into dt from dual;
      6  dbms_output.put_line(dt);
      7* end;
    SQL> /
    
    Procedure created.
    
    SQL> alter session set nls_date_format = 'DD-MM-YYYY';
    
    Session altered.
    
    SQL> select sysdate from dual;
    
    SYSDATE
    ----------
    21-07-2011
    
    SQL> set serveroutput on
    SQL> begin
      2  p1_nls();
      3  end;
      4  /
    21-JUL-2011
    
    PL/SQL procedure successfully completed.
    
  • ORA-01849: time must be between 1 and 12

    Hi all



    SELECT SYSDATE FROM DUAL;

    Returns

    MAY 11, 2011 17:33



    SELECT * FROM stables of TIMESTAMP TO_TIMESTAMP (May 11, 2011 14:30 '); Returns

    ORA-01849: time must be between 1 and 12

    Any idea?


    Kai

    Hi, Kai,

    KaiS wrote:
    Hi all

    SELECT SYSDATE FROM DUAL;

    Returns

    MAY 11, 2011 17:33

    SELECT * FROM stables of TIMESTAMP TO_TIMESTAMP (May 11, 2011 14:30 '); Returns

    ORA-01849: time must be between 1 and 12

    Always pass arguments (at least) 2 to TO_TIMESTAMP, like this:

    TO_TIMESTAMP ( '11-MAY-2011 14:30:00'
              , 'DD-MON-YYYY HH24:MI:SS;
              )
    

    The second argument tells TO_TIMESTAMP what format you use. If you don't pass it, then TO_TIMESTAMP will use a default format, which may not be what you want or expect.

  • After my reboot of the iPhone, the iPhone must be re enabled and why?

    After my reboot of the iPhone, the iPhone must be re enabled and why? And the iPhone had no problem in the past. I need help!

    You have a SIM card installed? If not, install one. Then try to activate it.

  • What is the difference (if any) between iPhoto and iPhoto library? I managed to delete my pictures in freeing up space, but have a backup available. Do I have to download these two files in the pictures folder is one duplicate of the other?

    What is the difference (if any) between iPhoto and iPhoto library? I managed to delete my pictures in freeing up space, but have a backup available. I need to restore these two files in the folder images or one is one duplicate of the other?

    I use a MacBook Air 2013 model with a backup on a WD MyBook Duo disc for storage wireless as the Apple Time Machine.

    The Photos and the iPhoto library are totally separated - neither one is connected to the other somehow--you want to restore the library you need

    LN

  • Hi, I got my subscription for the year running last for Photoshop and Lightroom. Because I had the good idea to download the 2015 CC of Photoshop, I return to the evaluation period. I would like to know, when this period ends, will I get my subscribed v

    Hi, I got my subscription for the year running last for Photoshop and Lightroom. Because I had the good idea to download the version of Photoshop CC 2015 (I thought it was just an update...), I get to the evaluation period.

    I would like to know, when this period expires, will I get my purchased version back or should I get a new subscription?

    If I get a new subscription, one is cancelled automatically, or do I have to do something else?

    Thanks a lot for the answers!

    If you are subscribed to the creative cloud, Creative Cloud 15 updates are included.

    If when you updated, all or part of the CC apps show 'trial start or buy now' in the creative cloud desktop application, please see this link:

    https://helpx.Adobe.com/manage-account-membership/CC-reverts-to-trial.html

  • Share the local CVS folder between SQLDeveloper and TortoiseCVS?

    Hi all

    I tried to play with CVS for developers SQL Support, but can't do things.

    I would order a module CVS using TortoiseCVS (such as C:\Project\ragtest\), because there are not many files associated with the database in there.
    To edit, compile and validate my data packets, I would use SQL Developer, but here SQL Developer to share my local folder (C:\Project\ragtest) with TortoiseCVS.

    Is this possible?

    Peter

    I can make it work as follows.

    TortoiseCVS, set CVSROOT if necessary (for example: pserver:myuser@mycvsserver:/cvs)
    In SQLDeveloper, create a new connection to CVS with exactly the same CVSROOT.

    You should be able to see all the modules in the browser Versioning and TortoiseCVS.

    Order a module of TortoiseCVS
    Open the file in SQLDeveloper browser and go to the directory that you extracted to. The files should appear with the icons of overlay CVS and version.

    Change a file in SQLDeveloper.
    The State of the file must pass in SQLDeveloper and TortoiseCVS.

    Modify a file outside SQLDeveloper
    You must use the refresh of the display for the status change in SQLDeveloper.

Maybe you are looking for