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 -> Help,Declare a cursor in stored procedure.

Help,Declare a cursor in stored procedure.

From: <shu_at_openix.com>
Date: 1997/03/13
Message-ID: <5g9qf9$g98$1@spasmolytic.openix.com>#1/1

Hi, all,

Inside stored procudure, how do I declare a cursor based on a table to be create before the cursor is declared ? Since the table doesn't exist, I got compiling error. Is there a way work out this? Here is what I did:

CREATE OR REPLACE PROCEDURE DoSomething([Parameter list]) IS

.....

BEGIN
.....
.....

	/* Dynamic create table by using DBMS_SQL package */
	create_object('table', 'my_table_a', sub_query);

	DECLARE
		CURSOR a_cur
		IS
			SELECT a1,a2,..,an FROM my_table_a
			WHERE .....;
	BEGIN
		/* Do something here */
	END;

END Thanks in advance.

Shaojie Hu Received on Thu Mar 13 1997 - 00:00:00 CST

Original text of this message

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