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!

loading null using sql loader

YoohooApr 16 2014 — edited Apr 17 2014

hi there,

i am trying to load data using sqlloader but some records are getting skip.  this is my data, ctl and table

1,"0000"

2,"0003"

3,"0004"

6,

LOAD DATA

REPLACE

INTO TABLE test_multi_loader

WHEN G_ID <> '0003'

FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'

TRAILING NULLCOLS

( FIELD1,

  G_ID

)

CREATE TABLE test_multi_loader (

  field1  NUMBER(10,0) NOT NULL,

  g_id VARCHAR2(20) NULL

)

i am trying to load data where G_ID <> '0003'. when i try loading the data mentioned above, only 0000 and 0004 gets inserted.   0003 get skip due to when clause which is expected

but the last row with null g_id also get skip and not loaded in the table.  is it because null is not equal to anything.  how can i load the last row using my control file above?

i am using oracle 10g with latest patch. thanks

current output

==========

field1    g_id

1          0000

3          0004

the below output is what i want

==========

field1    g_id

1          0000

3          0004

6         

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 15 2014
Added on Apr 16 2014
6 comments
6,990 views