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

Home -> Community -> Usenet -> c.d.o.server -> Re: How to load a string with blanks into a varchar2 not null column using SQL*Loader

Re: How to load a string with blanks into a varchar2 not null column using SQL*Loader

From: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Sun, 21 Sep 2003 21:41:45 -0700
Message-ID: <1064205694.309235@yasure>


Branko Milosavljevic wrote:

>Hi all,
>
>I have a table with a "varchar2(200) not null" column. Trying to load
>data with SQL*Loader where a row has the value of " " (a single blank
>character) produces the row in the database that contains a string
>with a single character '\0'. Tried to use PRESERVE BLANKS with no
>effect. Here's the control file:
>
>LOAD DATA
>INFILE 'data.dat'
>PRESERVE BLANKS
>INTO TABLE test_table
>TRAILING NULLCOLS
>( test_id, test_text)
>
>Greetings,
>Branko Milosavljevic
>
>

Put DECODE into your SQL*Loader script and convert to NULL. This can also be done with a BEFORE-INSERT trigger on the table.

-- 
Daniel Morgan
http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp
http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Sun Sep 21 2003 - 23:41:45 CDT

Original text of this message

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