Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

sqlldr : How to upload records where all columns are null

4 views
Skip to first unread message

toto

unread,
Mar 28, 2006, 12:25:02 AM3/28/06
to
Hi,

I am having following table

09:48:42 SQL> desc t
Name Null? Type
----------------------------------------- --------
----------------------------
A CHAR(1)
B NUMBER


I am having following contorlfile t.ctl to upload records

LOAD DATA
INFILE *
INTO TABLE T
REPLACE
FIELDS TERMINATED BY ','
TRAILING NULLCOLS
(
a nullif a="(null)"
,b nullif b="(null)"
)
BEGINDATA
A,2
(null),(null)
(null),(null)
(null),9
B,(null)
(null),10
(null),(null)
C,1
(null),(null)
(null),(null)
(null),(null)

When I try to do upload using sqlldr sqlldr xxxx/yyyy control=t.ctl
log=t.log I am getting following error

Table T, loaded from every logical record.
Insert option in effect for this table: REPLACE
TRAILING NULLCOLS option in effect

Column Name Position Len Term Encl Datatype
------------------------------ ---------- ----- ---- ----
---------------------
A FIRST * , CHARACTER
NULL if A = 0X286e756c6c29(character '(null)')
B NEXT * , CHARACTER
NULL if B = 0X286e756c6c29(character '(null)')

Record 2: Discarded - all columns null.
Record 3: Discarded - all columns null.
Record 7: Discarded - all columns null.
Record 9: Discarded - all columns null.
Record 10: Discarded - all columns null.
Record 11: Discarded - all columns null.

Table T:
5 Rows successfully loaded.
0 Rows not loaded due to data errors.
0 Rows not loaded because all WHEN clauses were failed.

I want to all insert all records where all fields are null. How can I
do this ?

thanks & regards
pjp

Mark D Powell

unread,
Mar 28, 2006, 11:13:31 AM3/28/06
to
PJP, logically trying to insert a row where all columns values are
missing/unknown does not make any sense. You only have 5 rows of data
in your post.

This table appears to have no PK. What is it you are trying to do?

What edition and version of Oracle are you working with? (Always
important in determining possible features that may be used as part of
valid solution)

HTH -- Mark D Powell --

Mark D Powell

unread,
Mar 30, 2006, 3:31:33 PM3/30/06
to
This thread is also on the .misc board where the question has been
restated.
0 new messages