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: Help: To_date() problem in Pro*C ??

Re: Help: To_date() problem in Pro*C ??

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Fri, 04 Jun 1999 16:16:26 GMT
Message-ID: <3758fb89.15490123@newshost.us.oracle.com>


A copy of this was sent to Mirza Mohsin Beg <mbeg_at_netearnings.com> (if that email address didn't require changing) On Thu, 03 Jun 1999 20:42:26 -0700, you wrote:

>
>
>I have the following code (with NLS_DATE_FORMAT set as 'DD-MON-YYYY' in
>init.ora)
>
>{
>exec sql begin declare section
>localDateField char[25] = "03-JUN-1999 12:24:34";
>localSelectField char[5] = "";
>exec sql end declare section
>
>exec sql
>select 'x' into :localSelectField
>from dual
>where trunc(sysdate) = to_date(:localDateField, 'DD-MON-YYYY');
>
>}
>
>This gives me
>Ora-01830: date format picture ends before converting entire input
>string.
>What is going on ? What am I doing wrong?
>

you have a date time input string and you are only using the date picture.

to_date( :localDateField, 'dd-mon-yyyy hh24:mi:ss' )

will work. The error message is saying "i ran out of the date format before i finished parsing your input string -- after i hit the yyyy in your input string there was still more data"

>Thanks,
>
>-M
>ps: please email me directly also
>

See http://www.oracle.com/ideveloper/ for my column 'Digging-in to Oracle8i'...  

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Service Industries
Reston, VA USA

--
Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Fri Jun 04 1999 - 11:16:26 CDT

Original text of this message

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