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 -> PL/SQL variables in the "from" part of a select statement

PL/SQL variables in the "from" part of a select statement

From: rac <caronra_at_pweh.com>
Date: 22 Nov 2002 09:06:29 -0800
Message-ID: <3fee8adb.0211220906.32984e6e@posting.google.com>


Does anyone know if it is possible to access a variable in the "from table" section of a query?
I have the following code (not exact)

DECLARE
 local_var VARCHAR2(30);
 count1 NUMBER;

CURSOR list_tables is
  select table_name from all tables;

BEGIN
open list_tables;
LOOP
FETCH list_tables INTO local_var;

select count(*) into count1 from local_var;

Error resulting is:
ORA-06550: line .......
PLS-00201: identifier 'LOCAL_VAR' must be declared.

Any suggestions??

Thanks. Received on Fri Nov 22 2002 - 11:06:29 CST

Original text of this message

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