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

Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL*Loader control file default values

Re: SQL*Loader control file default values

From: Dieter Ratsch <kdr_at_epost.de>
Date: Sun, 25 Aug 2002 23:50:51 +0200
Message-ID: <akbjec$nnm$01$1@news.t-online.com>


BVince2172 wrote:
> How can I specify the current date as a default value for a field, if the
> relevent field in the incoming data file is actually null?
>
> On a similar note, is it possible to truncate an incoming varchar2 if it's over
> a certain length?
>

Hi,
try something like this in your loader-controlfile:

     dat1 POSITION (001-010) DATE "NVL(:dat1, SYSDATE)",

A possible solution for your second question: (Example for a column-width of varchar2(10) and a length of the incoming datafield is 20 bytes)

    field1 POSITION (001-020) CHAR "SUBSTR(:field1, 1, 10)", or - much easier -

    field1 POSITION (001-010) CHAR,

hope, this work
Dieter Received on Sun Aug 25 2002 - 16:50:51 CDT

Original text of this message

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