Re: SQL*Loader default field value

From: Michael Krolewski <vandra_at_u.washington.edu>
Date: Fri, 01 May 1998 00:48:39 -0700
Message-ID: <35497E57.B9483173_at_u.washington.edu>


markjo_at_cwcinc.com wrote:

> I have a table in an Oracle 8 database that has three fields that make up the
> primary key. I am loading it with the following control file:
>
> LOAD DATA
> INFILE 'PARTDESCRIPTIONs.txt'REPLACE
> INTO TABLE PART_NUMBER_DESCRIPTIONS
> ( PART_DESCRIPTION POSITION( 1: 30),
> ITEM_CODE POSITION( 31: 42),
> PART_TYPE POSITION( 43: 43)
> )
>

    The refered to syntax

        part_type position (43:43) "nvl(:part_type, ' ')"

Any field can have a SQL function applied to it for each record by adding SQL in double quotes after the position information. The variable is referenced as <colon><fieldName>
Basically anything that you can do as part of the field declaration in a SQL select statement can be applied.

Mike Krolewski

> The problem is the Part_Type field could have just a space in it but the
> loader takes it as a NULL and throws the record out because the field cannot
> be NULL.
>
> There was a reply to another message about using :nvl(my field name, ' ') in
> the field description but I haven't found a syntax it likes.
>
> Any help would be greatly appreciated.
>
> Thanks in advance.
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/ Now offering spam-free web-based newsreading
Received on Fri May 01 1998 - 09:48:39 CEST

Original text of this message