dbTalk Databases Forums  

How To?: Cursors and Recursion

comp.database.oracle comp.database.oracle


Discuss How To?: Cursors and Recursion in the comp.database.oracle forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Alexander Pino
 
Posts: n/a

Default How To?: Cursors and Recursion - 06-03-2004 , 08:12 AM






How can I declare a local cursor within a recursive function? What this
function does is it clean up a hierarchy.

I know in SQL Server it is DECLARE xxx CURSOR LOCAL FOR ....

, but for Oracle I don't know it.

Could someone please help me?

Thanx,
Alexander



Reply With Quote
  #2  
Old   
Richard Xu
 
Posts: n/a

Default Re: How To?: Cursors and Recursion - 06-04-2004 , 11:39 PM






You could declare a dynamic cursor like this:
cursor name(variable varchar2) is
select whatever you want
from table
where columnname=(variable);

so you could call the function recursively and tranfer the parameter.

"Alexander Pino" <Alexander.Pino (AT) cea-int (DOT) com> wrote

Quote:
How can I declare a local cursor within a recursive function? What this
function does is it clean up a hierarchy.

I know in SQL Server it is DECLARE xxx CURSOR LOCAL FOR ....

, but for Oracle I don't know it.

Could someone please help me?

Thanx,
Alexander





Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.