title: SQL Loader Error: "Variable length field exceeds maximum length."
body: <p>I have a SQL Loader Control file,</p>
  
  <pre><code>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)
  )
  </code></pre>
  
  <p>and it's giving me an error when I run SQL Loader on it,<br>
  <code>Record 1: Rejected - Error on table TEST, column FILENAME.
  Variable length field exceeds maximum length.</code></p>
  
  <p>Here's that row.. the length of that column is way under 255..</p>
  
  <p><code>1|5001572|2|/Storage/Test/5001572/test.pdf|test.pdf||2005-01-13 11:47:49||</code></p>
  
  <p>And here's an oddity I noticed within the log file</p>
  
  <p><code>Column Name | Position | Len | Term | Encl | Datatype</code><br>
  <code>FILENAME | NEXT | 257 | | | VARCHAR</code></p>
  
  <p>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.</p>
  
  <p>Any help? This has bugged me for two days now.</p>
  
  <p>Thanks.</p>