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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Easy-to-Answer Question from Newbie

Re: Easy-to-Answer Question from Newbie

From: Niall Litchfield <niall.litchfield_at_dial.pipex.com>
Date: Fri, 3 Jan 2003 21:33:55 -0000
Message-ID: <3e1601bc$0$234$cc9e4d1f@news.dial.pipex.com>


try

declare
  query_table_name VARCHAR2(32) := 'SYS.V_$SESSION'; begin
  execute immediate 'select * from '||query_table_name; end;
/

--
Niall Litchfield
Oracle DBA
Audit Commission UK
*****************************************
Please include version and platform
and SQL where applicable
It makes life easier and increases the
likelihood of a good answer
******************************************
"Joe" <jdog10001_at_hotmail.com> wrote in message
news:f48de37.0301031315.46a148b9_at_posting.google.com...

> Is there an easy way to correct this problem without hardcoding the
> value in the SELECT statement or passing the value in as a parameter?
>
>
>
> declare
> query_table_name VARCHAR2(32) := 'SYS.V_$SESSION';
> begin
> select * from query_table_name;
> end;
> /
>
>
> =======================================
> ORA-06550: line 4, column 17:
> PLS-00201: identifier 'QUERY_TABLE_NAME' must be declared
> ORA-06550: line 4, column 3:
> PL/SQL: SQL Statement ignored
Received on Fri Jan 03 2003 - 15:33:55 CST

Original text of this message

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