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: PL/SQL

Re: PL/SQL

From: Guido Konsolke <Guido.Konsolke_at_triaton.com>
Date: Mon, 21 Jan 2002 11:24:50 +0100
Message-ID: <1011607907.697610@news.thyssen.com>


Sure, Wk,

just use a VARCHAR2-variable (named var_date for example ) and pass any date you like (in chars!) to it, e. g. to_char(sysdate - 1, 'dd-mm-rr') or a string from outside the pl/sql-block as a parameter. Then write
WHERE datetime between to_date(named_var || ':06:00:00', 'dd-mm-rr:hh24:mi:ss')...

Hth,
Guido

"WK Yeoh" <cwy006_at_motorola.com> schrieb im Newsbeitrag news:a2gd82$1ci$1_at_newshost.mot.com...
> Hi,
>
> I have a PL/SQL statement like below:
>
> CURSOR c1 IS
> SELECT *
> FROM xyz
> WHERE datetime between to_date('20-01-02:06:00:00','dd-mm-rr
hh24:mi:ss')
> and to_date('20-01-02:09:00:00','dd-mm-rr hh24:mi:ss');
>
> Is there any way I can substitute the date '20-01-02' portion with
> everyday's date instead of hard code it. The time of '06:00:00' is fixed.
>
> Pls help,
> Wk
>
>
>
Received on Mon Jan 21 2002 - 04:24:50 CST

Original text of this message

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