Using variables in FROM clause?
From: Mike Guerrero <mguerrer_at_mail.sdsu.edu>
Date: 1998/01/09
Message-ID: <01bd1d32$25aff220$1635bf82_at_sdu.sdsu.edu>#1/1
today varchar(10) := 'monday';
Date: 1998/01/09
Message-ID: <01bd1d32$25aff220$1635bf82_at_sdu.sdsu.edu>#1/1
[Quoted] [Quoted] In PL/SQL can you use a variable in the FROM clause of a 'select' statement [Quoted] or do you have to use the DBMS_SQL package to do this. For example, the following shows what I'd like to do:
tab1 varchar(30) ; c1 number(5);
today varchar(10) := 'monday';
if today = 'monday' then
tab1 := 'mytab' /* mytab and yourtab a different tables */ else
[Quoted] tab1 := 'yourtab';
select count(*) into c1 from tab1;
What are my options, if any? Thanks.
Mike Received on Fri Jan 09 1998 - 00:00:00 CET