Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL*Loader control file default values
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
![]() |
![]() |