?
Solved

a question of sqlldr

Posted on 2003-10-28
4
Medium Priority
?
1,932 Views
Last Modified: 2010-08-05
there is a table  tmp(a varchar2(3),b varchar2(3),rmk varchar2(6))

the content of tmp.txt  is:  
a|a
b|b

the content of tmp.ctl  is:
LOAD DATA
        INFILE 'tmp.txt'
        INTO TABLE tmp append
        FIELDS TERMINATED BY '|'
        (sn,
         agent,
         rmk "to_char(sysdate,'yyyymm')")

Run "sqlldr ltj/intelL control=tmp log=log.txt " ,then show :

“SQL string for column : "to_char(sysdate,'yyyymm')"

Record 1: Rejected - Error on table TMP, column RMK.
Column not found before end of logical record (use TRAILING NULLCOLS)”

why??
0
Comment
Question by:tjli
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 12

Accepted Solution

by:
catchmeifuwant earned 80 total points
ID: 9632998
Use trailing nullcols in your control file...

LOAD DATA
INFILE 'tmp.txt'
INTO TABLE tmp append
FIELDS TERMINATED BY '|'
trailing nullcols
(a,b,rmk "to_char(sysdate,'yyyymm')")
0
 
LVL 4

Expert Comment

by:Vinay_dba
ID: 9635087
SQL loader is expecting data as a|a|a. If last column/columns is null you have to use trailing nullcols.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question