Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to load a string with blanks into a varchar2 not null column using SQL*Loader
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