Go Back   CodingForums.com > :: Server side development > MySQL

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-16-2011, 10:56 PM   PM User | #1
philmetz
New Coder

 
Join Date: Aug 2008
Posts: 20
Thanks: 2
Thanked 0 Times in 0 Posts
philmetz is an unknown quantity at this point
Question SQL procedure

I need some help creating a recursive plsql procedure that will take in an ID and return a SET OF ID'S

Last edited by philmetz; 04-17-2011 at 08:58 PM..
philmetz is offline   Reply With Quote
Old 04-16-2011, 11:00 PM   PM User | #2
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,168
Thanks: 59
Thanked 3,993 Times in 3,962 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
The best way to do this is undoubtedly via a stored procedure.

Even better is to rebuild your table with a "path" column that will allow direct queries to find most anything.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote
Old 04-16-2011, 11:19 PM   PM User | #3
philmetz
New Coder

 
Join Date: Aug 2008
Posts: 20
Thanks: 2
Thanked 0 Times in 0 Posts
philmetz is an unknown quantity at this point
yea thats why im asking if anyone can help me create it or show me a similar example. I cant change the table.
philmetz is offline   Reply With Quote
Old 04-17-2011, 02:24 AM   PM User | #4
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,168
Thanks: 59
Thanked 3,993 Times in 3,962 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
Well, this is the MySQL forum, and few (if any) will know PLSQL. You'd be much better off finding an Oracle-specific forum.

I can write in MySQL and SQL Server, but I've never created SPs in Oracle.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

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

Forum Jump


All times are GMT +1. The time now is 06:23 PM.


Advertisement
Log in to turn off these ads.