Solved

a question of sqlldr

Posted on 2003-10-28
4
1,912 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.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
grouping on time windows 6 51
sort a spool into file output in oracle 1 28
Retreiving column names in Windows but not in Unix 11 44
Oracle - SQL Query with Function 3 34
Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

776 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