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

Home -> Community -> Mailing Lists -> Oracle-L -> Bug in Execute Immediate clause???

Bug in Execute Immediate clause???

From: Ranganath K <Ranganath_K01_at_infosys.com>
Date: Wed, 02 Jul 2003 09:34:26 -0700
Message-ID: <F001.005BDE3D.20030702073032@fatcity.com>

<span style='font-size:10.0pt;

font-family:Arial'>Hi Listers,

<span style='font-size:10.0pt;

font-family:Arial'> 

<span style='font-size:10.0pt;

font-family:Arial'>The below procedure gets created successfully in TEST Schema.  But when I execute the
procedure by starting a fresh session connecting as TEST schema I get the below error and when I execute the procedure for the second time it executes successfully.  I have granted the <span
class=SpellE>dba privileges and explicit granted select on TEMP1 to TEST Schema.  Inspite
of that I am getting the below errors. 
I tried this 8.1.7 and 9.2.1.0. 
Is it a bug in the code or the database?<span style='mso-spacerun:yes'> 

<span style='font-size:10.0pt;

font-family:Arial'> 

<span style='font-size:10.0pt;

font-family:Arial'>CREATE OR REPLACE procedure test authid current_user is

<span

style='font-size:10.0pt;font-family:Arial'>c<font size=2 face=Arial> number;

<span

style='font-size:10.0pt;font-family:Arial'>n<font size=2 face=Arial> number;

<span

style='font-size:10.0pt;font-family:Arial'>a<font size=2 face=Arial> varchar2(1000);

<span style='font-size:10.0pt;

font-family:Arial'>Begin

<span style='font-size:10.0pt;

font-family:Arial'>Execute Immediate 'Alter Session Set Current_Schema = SCOTT';
<span

style='font-size:10.0pt;font-family:Arial'>Dbms_output.put_line<span class=GramE><span style='font-size:10.0pt;font-family: Arial'>(<span
style='font-size:10.0pt;font-family:Arial'>sys_context<font size=2 face=Arial>('<span
class=SpellE>userenv', 'Current_schema'));

<span style='font-size:10.0pt;

font-family:Arial'>Select count(*) into c >From temp1;

<span

style='font-size:10.0pt;font-family:Arial'>Dbms_output.put_line<font size=2 face=Arial>(c);

<span style='font-size:10.0pt;

font-family:Arial'>End;

<span style='font-size:10.0pt;

font-family:Arial'> 

<span style='font-size:10.0pt;

font-family:Arial'>ERROR at line 1:

<span style='font-size:10.0pt;

font-family:Arial'>ORA-00942: table or view does not exist

<span style='font-size:10.0pt;

font-family:Arial'>ORA-06512: at "TEST.TEST", line 9

<span style='font-size:10.0pt;

font-family:Arial'>ORA-06512: at line 1

<span style='font-size:10.0pt;

font-family:Arial'> 

<span style='font-size:10.0pt;

font-family:Arial'>Can anybody help me out?<span style='mso-spacerun:yes'>  Any help in this regard is very much appreciated.

<span style='font-size:10.0pt;

font-family:Arial'> 

<span style='font-size:10.0pt;

font-family:Arial'>Thanks and Regards,

<span style='font-size:10.0pt;

font-family:Arial'> 

<span style='font-size:10.0pt;

font-family:Arial'>Ranganath Received on Wed Jul 02 2003 - 11:34:26 CDT

Original text of this message

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