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: SQL*Loader

Re: SQL*Loader

From: Richard Kuhler <noone_at_nowhere.com>
Date: Fri, 08 Mar 2002 02:29:02 GMT
Message-ID: <OlVh8.11761$Gu6.5360150@typhoon.san.rr.com>


> to_conversion_date DATE(10) "(select to_char((sysdate + 3),
> 'MM-DD-YYYY') from dual)",
> but this is failing...don't know why...

Well, if that's what you really have in the control file, I would say it's the 'DATE(10)' part. Don't you mean 'CHAR'? Actually, why even bother with a datatype at all here?

However...

  1. per Prasad's message this would be easier/faster with "to_char(sysdate + 3, 'MM-DD-YYYY')"
  2. are you really sure you want to store a date as a string? why not just store the date?

Richard

Ian Terence Botham wrote:
>
> Sybrand Bakker <postbus_at_sybrandb.demon.nl> wrote in message news:<eqof8ugp3m3sogiegeujl0ce8rf8rt3e17_at_4ax.com>...
> > On 7 Mar 2002 12:24:19 -0800, botham_ian_at_hotmail.com (Ian Terence
> > Botham) wrote:
> >
> > >Can I call a select satement in the SQL*Loader control file..
> > >Like for example...
> > >
> > >LOAD DATA
> > >APPEND INTO TABLE xx
> > >(
> > >from_conversion_date DATE(10) "MM-DD-YYYY",
> > >to_conversion_date "select to_char(SYSDATE,'MM-DD-YYYY') from dual",
> > >)
> > >
> > >I am referring to the select statement in the second column..
> > >
> > >I tried these but am getting unusual errors.. like missing expression,
> > >missing right parantheses when everything seems fine...
> > >
> > >Which drives me to the very question whether select statemets like the
> > >above are welcome in SQL*Loader.....or how else would one enter
> > >sysdate or tomorrow's date through sql*loader...
> > >
> > >Thanks
> > >Ian.............
> >
> >
> > The select is unnecessary as you can in your CREATE TABLE statement
> > DEFAULT a column to SYSDATE, as you can do in SQL*Loader.
> >
> > Regards
> >
> >
> > Sybrand Bakker, Senior Oracle DBA
> >
> > To reply remove -verwijderdit from my e-mail address
>
> LOAD DATA
> APPEND INTO TABLE xx(
> from_conversion_date DATE "MM-DD-YYYY",
> to_conversion_date DATE(10) "(select to_char((sysdate + 3),
> 'MM-DD-YYYY') from dual)",
> --to_conversion_date "(select to_char(SYSDATE,'MM-DD-YYYY')from
> dual)",
> --to_conversion_date "SYSDATE + 3",
> )
>
> Many thanks for the solution, Ok ,, here is what I found,, now ,I want
> to insert a date that is 3 days ahead of SYSDATE into the table...The
> commented out pieces in my code produces the result
> --to_conversion_date "(select to_char(SYSDATE,'MM-DD-YYYY')from
> dual)",
> Gives me the SYSDATE through a Select Statement( an eye-opener for me)
>
> --to_conversion_date "SYSDATE + 3",
> Gives me the sysdate 3 days ahead of today,, fine,, but not in
> MM-DD-YYY format.
>
> to_conversion_date DATE(10) "(select to_char((sysdate + 3),
> 'MM-DD-YYYY') from dual)",
> but this is failing...don't know why...
>
> Sorry for bugging you guys.. but before I did send the first message,
> I was still pondering whether to go with SQl*Loader or
> Perl::DBI.......But your responses did really changed my earlier
> plans...
>
> Thanks
> Ian...
Received on Thu Mar 07 2002 - 20:29:02 CST

Original text of this message

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