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: to_date format

Re: to_date format

From: Brian Peasland <dba_at_nospam.peasland.net>
Date: Tue, 19 Sep 2006 17:39:34 GMT
Message-ID: <J5up28.3G5@igsrsparc2.er.usgs.gov>


mattjones_at_hotmail.co.uk wrote:
> Hi
> Im trying to convert part of a string into a date. So far i have:
> $dbh->do ("INSERT INTO TEST4 (log_name) VALUES (TO_DATE('$filename',
> 'YYYYMMDDHH24'))");
>
> where:
> $filename = 2006090603_103_fs.log
>
> i need the 2006090603 to be changed into a date and placed itno a field
> but i also need the '103' placed into a seperate field.
>
> The above statement is giveing me the error :
> RA-01830: date format picture ends before converting entire input
> string
>
> I think its because i am telling it what to do with the '2006090603'
> part of the name but then it doesn't know what to do with
> '_103_fs.log'. Is there a format so the sql omit's this last bit of
> information?
>
> Any thoughts on this?
>

One other note....your code is most likely not using bind variables. Consider using bind variables so that performance will not suffer.

HTH,
Brian

-- 
===================================================================

Brian Peasland
dba_at_nospam.peasland.net
http://www.peasland.net

Remove the "nospam." from the email address to email me.


"I can give it to you cheap, quick, and good.
Now pick two out of the three" - Unknown
Received on Tue Sep 19 2006 - 12:39:34 CDT

Original text of this message

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