Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: ** default in sql loader

RE: ** default in sql loader

From: A Joshi <ajoshi977_at_yahoo.com>
Date: Fri, 30 Jul 2004 11:17:27 -0700 (PDT)
Message-ID: <20040730181727.46164.qmail@web60710.mail.yahoo.com>


Thanks Tom. That helped.
"Mercadante, Thomas F" <thomas.mercadante_at_labor.state.ny.us> wrote:Joshi,

It is actually working as it is supposed to work. The default value is only included if the column is not used in the insert statement.

For Sql*Loader purposes, I would use a nvl function in the sql*loader control file to load the value you need. The control file would look something like:

Col_name terminated by "," "nvl(:Col_name,'YOUR VALUE')"

Good Luck!

Tom Mercadante
Oracle Certified Professional

-----Original Message-----

From: A Joshi [mailto:ajoshi977_at_yahoo.com] Sent: Wednesday, July 28, 2004 1:39 PM
To: oracle-l_at_freelists.org
Subject: ** default in sql loader

Hi,
I have table and it has a field that has a default. I am loading the table from sql*loader. When the field is null in data file I want it to put the default. However it does not work. Even at sqlplus level if I insert a row using insert into .... values... it only puts the default if the field is not included. If the field is included in the list and a null is specified then it does not put the default.
One way to overcome this is have a pre-insert trigger which checks for null and then puts the default but I am avoiding that and also if the default changes then I have to change the trigger. MAybe I am missing something basic here. Can someone help. Thanks



Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!

Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--

Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html

-----------------------------------------------------------------
----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to: oracle-l-request_at_freelists.org
put 'unsubscribe' in the subject line.
--

Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
                

Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses.

Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--

Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
Received on Fri Jul 30 2004 - 13:14:06 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US