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: accept that is century-compliant

Re: accept that is century-compliant

From: Stephane Faroult <sfaroult_at_oriolecorp.com>
Date: Thu, 18 Mar 1999 20:17:07 -0800
Message-ID: <36F1CFC2.1AD6@oriolecorp.com>


hf wrote:
>
> How do I make the following century compliant?
> My email is: hessel_at_fdp.co.za
>
> accept dt prompt "Enter date (dd-mon-yyyy): "
> select count(*) from file1 where tr_date >= '&dt'

1)Either you set the default date format to be the format you expect, which can be done either at the database level by setting in your parameter file (the so-called init.ora file) nls_date_format = 'DD-MON-YYYY'
or at the session level by executing
alter session set nls_date_format = 'DD-MON-YYYY'

2)Or, and this is certainly what I would do (never rely on implicit date format!) you just specify the format in your query : select count(*) from file1 where tr_date >= to_date('&dt','DD-MON-YYYY') --
Regards,

  Stéphane Faroult
  Oriole Corporation



 http://www.oriolecorp.com, created by Oracle DBAs for Oracle DBAs
Received on Thu Mar 18 1999 - 22:17:07 CST

Original text of this message

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