More of the ongoing battle with dbms_sql

From: Brian Martin <icbkr_at_ix.netcom.com>
Date: 1996/09/11
Message-ID: <3236E81F.2FF0_at_ix.netcom.com>#1/1


Okay, I finally dbms_sql running. Never, and I mean *never* name a variable "return". You wouldn't believe the hoops you jump through trying to trace *that* one down. Why can't Oracle pick up on the use of reserved words like other compilers? Anyway, back to dbms_sql.

I want to execute a procedure in my passed statement, but I get ye olde error: ORA-06512 and ORA-0900. Woohoo.

I know I can't run execute from inside, but why not a procedure?

To run the below stuff, I'm at a SQL> prompt and doing "execute exec;"
I get the above error messages, which indicates it's barfing on the procedure, but there MUST BE A WAY!!! Here's the example code:

>>>>>>>>>create or replace package bcm as

   procedure exec;
   procedure dummy;
end bcm;
/
show errors;

create or replace package body bcm as

procedure exec is

	mcursor integer;
	mstring varchar2(80);
	mreturn integer;

begin

   mcursor := dbms_sql.open_cursor;
   mstring := 'bcm.dummy'; /* le prog to run */    dbms_sql.parse(mcursor, mstring, dbms_sql.v7);    mreturn := dbms_sql.execute(mcursor);    dbms_sql.close_cursor(mcursor);
end exec;

procedure dummy is
foo integer;
begin

   select count(*) into foo from tab;
end dummy;

end bcm;
/
show errors; Received on Wed Sep 11 1996 - 00:00:00 CEST

Original text of this message