Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2004
    Location
    ny
    Posts
    16

    Unanswered: sql loader problem

    hello,
    I'm trying to load data to oracle table

    I have an xls spreadsheet
    with data

    my loader looks like this:
    load data
    infile 'd:\temp\newrel.csv'
    truncate
    into table best_b
    fields terminated by ','
    (upc char, tesxt1 varchar, test2 varchar)

    every time i do execute of it ctl file i get an error:
    column not found before end of logical record (use trailing nullcols)


    please help

  2. #2
    Join Date
    Nov 2003
    Posts
    65

    Re: sql loader problem

    I can probably help more if you give me a snapshot of the csv file.
    and maybe your table declaration, what you see in Oracle.

    It seems that maybe your syntax might be a little off IN UR ctl FILE.
    maybe try this:
    Code:
    LOAD DATA
    TRUNCATE
    INFILE 'd:\temp\newrel.csv'
    INTO TABLE BEST_B
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'  trailing nullcols
    (UPC,
    TEST1,
    TEST2)
    hope that helps if not post what i asked for.

    Originally posted by igorem
    hello,
    I'm trying to load data to oracle table

    I have an xls spreadsheet
    with data

    my loader looks like this:
    load data
    infile 'd:\temp\newrel.csv'
    truncate
    into table best_b
    fields terminated by ','
    (upc char, tesxt1 varchar, test2 varchar)

    every time i do execute of it ctl file i get an error:
    column not found before end of logical record (use trailing nullcols)


    please help

  3. #3
    Join Date
    Jan 2004
    Posts
    20

    Re: sql loader problem

    Hi,
    When the control file definition specifies more fields for a record than that are present in the data files, SQL*Loader must determine whether the remaining (specified) col-umns should be considered null or whether an error should be generated.
    So most probably the number of entries present in your ctl file is more than the number of entries present in your data file .
    Regards
    Satya

  4. #4
    Join Date
    Feb 2004
    Posts
    7

    Re: sql loader problem

    try the following one, pay attendation to fifth row.

    load data
    infile 'd:\temp\newrel.csv'
    truncate
    into table best_b
    trailing nullcols
    fields terminated by ','
    (upc char, tesxt1 varchar, test2 varchar)


    Originally posted by igorem
    hello,
    I'm trying to load data to oracle table

    I have an xls spreadsheet
    with data

    my loader looks like this:
    load data
    infile 'd:\temp\newrel.csv'
    truncate
    into table best_b
    fields terminated by ','
    (upc char, tesxt1 varchar, test2 varchar)

    every time i do execute of it ctl file i get an error:
    column not found before end of logical record (use trailing nullcols)


    please help

  5. #5
    Join Date
    Jan 2004
    Posts
    20

    Re: sql loader problem

    Hi,
    When the control file definition specifies more fields for a record than that are present in the data files, SQL*Loader must determine whether the remaining (specified) col-umns should be considered null or whether an error should be generated.
    So most probably the number of entries present in your ctl file is more than the number of entries present in your data file .
    Regards
    Satya

  6. #6
    Join Date
    Nov 2003
    Posts
    65

    Re: sql loader problem

    well not really... if the database table is set correctly it wont generate an error. If the table is defined as having a certain column as DEAFULT ' ' or a number like 0 or null ... it will insert that default if no value is found in the datafile.


    Originally posted by satya_x
    Hi,
    When the control file definition specifies more fields for a record than that are present in the data files, SQL*Loader must determine whether the remaining (specified) col-umns should be considered null or whether an error should be generated.
    So most probably the number of entries present in your ctl file is more than the number of entries present in your data file .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •