Home » RDBMS Server » Server Utilities » loading null values in date column using sql loader (merged)
loading null values in date column using sql loader (merged) [message #425420] Fri, 09 October 2009 02:01 Go to next message
sdas7
Messages: 1
Registered: October 2009
Junior Member
Hello everyone.....

I am using sql loader to load the data from the text files to the oracle tables...I am facing a problem with it. The sample data has lot of null values in a column of date data type, which is also not in the default format. Can anyone please help me out with this issue.
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 P_ID                                               NVARCHAR2(20)
 DS_ID                                              NVARCHAR2(20)
 SYMPTOM                                            VARCHAR2(30)
 DS_FROM                                            DATE
 DS_TO                                              DATE
 DR_ID                                              NUMBER(8)
 DOSAGE                                             NUMBER(3)
 DR_FROM                                            DATE
 DR_TO                                              DATE
 TT_ID                                              NUMBER(5)
 RESULT                                             VARCHAR2(20)
 TT_DATE                                            DATE
 S_ID                                               NUMBER(10)
and the loader file is
load data
infile './Data_For_Project1/clinical_fact.txt'
INTO TABLE clinical_fact FIELDS TERMINATED BY '\t'
(p_ID, ds_id, symptom, ds_from"to_date(:ds_from,'YYYY-MM-DD')", ds_to"to_date(:ds_to,'YYYY-MM-DD')", dr_id, dosage, dr_from"to_date(:dr_from,'YYYY-MM-DD')", dr_to"to_date(:dr_to,'YYYY-MM-DD')", tt_id, result, tt_date"to_date(:tt_date,'YYYY-MM-DD')", s_id)

Your help is very much needed ....

Thanks a lot

[EDITED by LF: applied [code] tags]

[Updated on: Fri, 09 October 2009 12:10] by Moderator

Report message to a moderator

Re: loading null values in date column using sql loader (merged) [message #425435 is a reply to message #425420] Fri, 09 October 2009 02:43 Go to previous messageGo to next message
Michel Cadot
Messages: 68641
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code, use code tags.
Use the "Preview Message" button to verify.
Also always post your Oracle version with 4 decimals.

Copy and paste some data and your log file and result with them.

Regards
Michel
Re: loading null values in date column using sql loader (merged) [message #425533 is a reply to message #425420] Fri, 09 October 2009 08:30 Go to previous message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
Try using TRAILING NULLCOLS.

[added]

But how could data be NULL and also in be in a default format? Maybe I just do not know what you are asking.

[Updated on: Fri, 09 October 2009 08:32]

Report message to a moderator

Previous Topic: SQL Loader not loading the data file
Next Topic: SQL Loader
Goto Forum:
  


Current Time: Fri Apr 19 11:27:30 CDT 2024