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: Prasad Pelala <ppel_at_gwl.com>
Date: Fri, 04 Jun 1999 09:23:24 -0600
Message-ID: <3757EF6C.68EED77B@gwl.com>


Try using
>> where trunc(sysdate) = trunc(to_date(<whatever>, 'DD-MON-YYYY hh24:mi:ss'))

To_date looks for the exact format mentioned in the "format" parameter.

Hope this helps.

Prasad.

Mirza Mohsin Beg 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?
>
> Thanks,
>
> -M
> ps: please email me directly also
Received on Fri Jun 04 1999 - 10:23:24 CDT

Original text of this message

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