Solved

a question of sqlldr

Posted on 2003-10-28
4
1,897 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
4 Comments
 
LVL 12

Accepted Solution

by:
catchmeifuwant earned 20 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
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…

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now