Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7867891
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:49:49+00:00 2026-06-03T00:49:49+00:00

I have a SQL Loader Control file, LOAD DATA INFILE ‘test.txt’ INTO TABLE TEST

  • 0

I have a SQL Loader Control file,

LOAD DATA  
INFILE 'test.txt'  
INTO TABLE TEST replace  
fields terminated "|" optionally enclosed by '"' TRAILING NULLCOLS  
( DOCUMENTID INTEGER(10),  
  CUSTID INTEGER(10),  
  USERID INTEGER(10),  
  FILENAME VARCHAR(255),  
  LABEL VARCHAR(50),  
  DESCRIPTION VARCHAR(2000),  
  POSTDATE DATE "YYYY-MM-DD HH24:MI:SS" NULLIF POSTDATE="",  
  USERFILENAME VARCHAR(50),  
  STORAGEPATH VARCHAR(255)
)

and it’s giving me an error when I run SQL Loader on it,
Record 1: Rejected - Error on table TEST, column FILENAME.
Variable length field exceeds maximum length.

Here’s that row.. the length of that column is way under 255..

1|5001572|2|/Storage/Test/5001572/test.pdf|test.pdf||2005-01-13 11:47:49||

And here’s an oddity I noticed within the log file

Column Name | Position | Len | Term | Encl | Datatype
FILENAME | NEXT | 257 | | | VARCHAR

I define the length as 255 in both my table and control file. Yet the log spits it out as 257? I’ve tried knocking down the length in the control file to 253, so it appears as 255 in the log file, but the same issue.

Any help? This has bugged me for two days now.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T00:49:51+00:00Added an answer on June 3, 2026 at 12:49 am

    Don’t define your data fields as VARCHAR2 and INTEGER. Use CHAR. Most of the time, when loading data from a text file, you want to use CHAR, or perhaps DATE, although even that is converted from a text form. Most of the time you don’t even need a length specifier. The default length for a CHAR field is 255. Your control file should look something like:

    LOAD DATA
    INFILE "test.txt"
    INTO TABLE TEST replace
    fields terminated "|" optionally enclosed by '"' TRAILING NULLCOLS
    (
      DOCUMENTID,
      CUSTID,
      USERID ,
      FILENAME,
      LABEL,
      DESCRIPTION CHAR(2000),
      POSTDATE DATE "YYYY-MM-DD HH24:MI:SS" NULLIF POSTDATE=BLANKS,
      USERFILENAME,
      STORAGEPATH
    )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For example, I have a piece of code that's generating a SQL*Loader control file
I have a SQL*Loader control file that has a line something like this: FIELDS
In order to load data (from a CSV file) into an Oracle database, I
I want to use BCP to load into a SQL Server 2005 table with
I wrote a .sh script which should upload data from file by sql*loader and
So I have an SQL dump file that needs to be loaded using mysql_query().
I have SQL data that looks like this: events id name capacity 1 Cooking
I have setup a simple Oracle external table test that I (alongside a DBA
Scenario: I have a huge .csv file (million of lines) . With sqlldr (SQL
I am trying to load a large amount of data into my Oracle database,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.