Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Comparing Blank fields in data in When clause of sqlldr

Shubham ShuklaJan 13 2017 — edited Jan 17 2017

Hi everyone,

I am using sqlldr to load data into two different table using a single ctl file.

My CTL FIle is as follows-

LOAD DATA

INFILE test2.dat

APPEND

INTO TABLE  test2

WHEN S_NO = ''

FIELDS TERMINATED BY "|"

OPTIONALLY ENCLOSED  BY "'"

TRAILING NULLCOLS

(

S_NO ,

NAME ,

AGE

)

   INTO TABLE     test1

WHEN S_NO!= ''

----------------------------------------------------------------------

FIELDS TERMINATED    BY "|"

OPTIONALLY ENCLOSED  BY "'"

TRAILING NULLCOLS

(

S_NO POSITION(1),

NAME ,

AGE

)

My data file looks like-

''|'Name1'|'12'

'13'|'Name2'|'23'

The thing is i need to load data depending on value of S_NO column , if it is blank it should go in table test2 and if it has any value it should go in table test1.

Now the second row is being inserted in table test1 but the first row is not inserted in table test2.

So how to compare null column to blanks?

Any help would be appreciated.

thanks

Shubham Shukla

This post has been answered by Barbara Boehmer on Jan 16 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 14 2017
Added on Jan 13 2017
13 comments
1,029 views