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: SQL*Loader help - Another approach

Re: SQL*Loader help - Another approach

From: David A. Barbour <dbarbour_at_nucentrix.net>
Date: Fri, 30 Mar 2001 16:34:54 -0800
Message-ID: <F001.002DD93D.20010330155525@fatcity.com>

Chaim,

Along these lines, can't you disable the not null constraint, load the data, update the table/columns (UPDATE MY_TABLE SET THIS_COLUMN = 0 WHERE THIS COLUMN IS NULL) then re-enable the constraints?

David

Ron Rogers wrote:
>
> Chaim,
> If on the other hand the BLANK will not work properly on a numeric filed that is to
>be used in calculations. In that case you might want to have a 0(zero) loaded rather
>than a null,blank. Then you could use the NVL clause in your controll statement where
>the field type is numeric.
> ROR mª¿ªm
>
> >>> dbarbour_at_nucentrix.net 03/30/01 02:00PM >>>
> Chaim,
>
> Check out the sqlldr case studies on OTN. Ross has the right idea with
> the NULLIF. Here's a general description from OTN:
>
> Loading All-Blank Fields
>
> Totally blank fields for numeric or DATE fields cause the record to be
> rejected. To load one of these fields as null, use the NULLIF clause
> with the BLANKS keyword, as described in Comparing Fields to BLANKS.
> Case 6: Loading Using the Direct Path Load Method provides examples of
> how to load all-blank fields as null with the NULLIF clause.
>
> If an all-blank CHAR field is surrounded by enclosure delimiters, then
> the blanks within the enclosures are loaded. Otherwise, the field is
> loaded as null. More details on whitespace are presented in Trimming
> Blanks and Tabs and in Preserving Whitespace.
>
> Hope this helps.
>
> David A. Barbour
> Oracle DBA, OCP
> Chaim.Katz_at_Completions.Bombardier.com wrote:
> >
> > Maybe some could help me.
> > I'm having trouble trying to load a csv file with sqlldr. The destination table
> > has char columns defined as not null and the csv file has missing data for these
> > columns. (These columns will contain blanks in the database).
> >
> > Sqlldr wants to set the missing fields to null, which results in record
> > rejected errors. Is there a way around this. I would be happy if I could insert
> > blanks or insert any other marker-value into the field like '***'..
> > The input file lines looks something like (01110,,,,1,1,31460)
> > Thanks
> > Chaim
> >
> > --
> > Please see the official ORACLE-L FAQ: http://www.orafaq.com
> > --
> > Author:
> > INET: Chaim.Katz_at_Completions.Bombardier.com
> >
> > Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> > San Diego, California -- Public Internet access / Mailing Lists
> > --------------------------------------------------------------------
> > To REMOVE yourself from this mailing list, send an E-Mail message
> > to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> > the message BODY, include a line containing: UNSUB ORACLE-L
> > (or the name of mailing list you want to be removed from). You may
> > also send the HELP command for other information (like subscribing).
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: David A. Barbour
> INET: dbarbour_at_nucentrix.net
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
>
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: Ron Rogers
> INET: RROGERS_at_galottery.org
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: David A. Barbour
  INET: dbarbour_at_nucentrix.net

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Fri Mar 30 2001 - 18:34:54 CST

Original text of this message

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