RE: Default value in sql loader constrol file?

RE: Default value in sql loader constrol file?

 

  


You can use the DEFAULTIF sql loader clause which will assign a default
value to a field if some condition is met. eg.

"PRICE" POSITION (31:44) DECIMAL EXTERNAL DEFAULTIF "PRICE"=BLANKS ,

but that doesn't let you specify what the default value is to be. It
will default to 0 for numeric fields and null for non-numeric fields.

If you leave a field out of your control file completely, the default
value for the table colunm will be used.

and, depending on your circumstances, you could potentially use a sql
function like NVL or DECODE in your control file to assign a default
value based on some other criteria. That will preclude doing a direct
load though.

HTH


-----Original Message-----
From: Puneet Sharma [mailto:[Email Address Removed]
Sent: Monday, June 30, 2003 4:17 PM
To: LazyDBA.com Discussion
Subject: Default value in sql loader constrol file?


Hi Everybody,

Can I assign a default value in Sql*Loader's control file for a column?

Thanks,
Puneet

_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail


--------
Oracle documentation is here:
http://tahiti.oracle.com/pls/tahiti/tahiti.homepage
To unsubscribe: send a blank email to oracledba-[Email Address Removed] subscribe: send a blank email to oracledba-[Email Address Removed] the list archive: http://www.LAZYDBA.com/odbareadmail.pl
Tell yer mates about http://www.farAwayJobs.com
By using this list you agree to these
terms:http://www.lazydba.com/legal.html

Oracle LazyDBA home page