Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: Variable in a select-script

Re: Variable in a select-script

From: Pierre Charpenay <pcharpenay_at_unilog.fr>
Date: 2000/06/28
Message-ID: <3959DC70.81FE44D@unilog.fr>#1/1

wilhelm a écrit :
>
> Hallo friends
> i am a beginner in pl/sql.............
>
> how can i introduce a variable in a select-script ?
> for example:
>
> BEGIN
> DECLARE
> now_time varchar2(2);
> ColName varchar2(7);
>
> BEGIN
> now_time:=to_char(sysdate,'mi');
>
> IF now_time='01' THEN
> SpName:='wert_20';
>
> select datum, ???now_time??? from tabel1

Just write :

  select datum, now_time from tabel1

You probably need an INTO clause to receive your datas ... ... but I can't see why you want to use the variable in the SELECT clause, it will always give you the same value !

> where datum = (select max(datum) from tabel1)
> END;
> END;
>
> Got questions? Get answers over the phone at Keen.com.
> Up to 100 minutes free!
> http://www.keen.com
 

-- 
 Pierre CHARPENAY
Received on Wed Jun 28 2000 - 00:00:00 CDT

Original text of this message

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