Re: PL/SQL - Variables in select statement

From: Mark Rittman <mark_at_snowball.freeserve.co.uk>
Date: Tue, 15 Dec 1998 20:39:23 -0000
Message-ID: <756hdd$u4n$1_at_newsreader2.core.theplanet.net>


or do what I did, and use the following command to create a synonym which you can reference from the select statement (this assumes your creating the procedure in Oracle Forms)

FORMS_DDL('Drop synonym temp');
FORMS_DDL('Create synonym temp for '||table_name);

then you can put in your procedure

Select column_name from temp;

this assumes the variable 'temp' contains your table_name

Best Regards
Mark Rittman
mrittman_at_tmf-europe.com

Peter Brenner wrote in message <7569lo$5pu$1_at_nw001t.infi.net>...
>Take a look at the DBMS_SQL package. It provides the functionality that
you
>need.
>
>
>Phack wrote in message <7566pr$fgo$1_at_news.cybercity.dk>...
>>I want to make the same select from several tables, and for that I want to
>>create a stored procedure that I call with at parameter consisting of the
>>table name. But I reach a dead-end of my knowledge and ability to find
>>information about how the select statement can use the variable. I am
>trying
>>to do the following
>>
>>create or replase search_tabel (tabel_name IN varchar2) is
>>
>> cursor c_table is
>> Select * from tabel_name
>> where ...;
>>
>>Begin
>> ...
>>
>>Apparrently this use of the parameter (tabel_name) is not valid. Could you
>>help me with how I should do this, and if it is possible at all?
>>
>>Thank's in advance,
>>
>>Paw
>>
>>
>
>
Received on Tue Dec 15 1998 - 21:39:23 CET

Original text of this message