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

Home -> Community -> Usenet -> comp.databases.oracle -> ORA-00911 in Dynamic SQL

ORA-00911 in Dynamic SQL

From: traceable1 <traceable1_at_hotmail.com>
Date: 8 Apr 2004 13:35:36 -0700
Message-ID: <8551d8c9.0404081235.4d9251c@posting.google.com>

I am trying to create a stored procedure with dynamic sql referencing the V$SESSION table (view). I need to use this dynamically, because the procedure will not compile if the user does not have access to this table. The $ is what's causing the trouble:

declare v_sql varchar2(4000);
begin
v_sql := 'select * from v$session;';
execute immediate (v_sql);
end;
/

I've tried \ and double quotes, but they don't work. Any clues?

THANK YOU!!!! trace Received on Thu Apr 08 2004 - 15:35:36 CDT

Original text of this message

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