Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Stored Procedures is Cursors...Anybody

2 views
Skip to first unread message

jimmyc

unread,
Dec 21, 2007, 2:06:44 PM12/21/07
to
I would like to see Stored Procedures be accessed from a Cursor...


Something like this......
declare authors_scroll_crsr scroll cursor
for exec sp_get_authors 'CA'
.
.
.

This would really make life easier as a developer.
There have been many moments where that feature would have saved me
lots of time.


Any thoughts????

Jimmy

jimmyc

unread,
Dec 21, 2007, 2:09:33 PM12/21/07
to
OOOOPS! I meant to write "Stored Procedured in Cursors..."

Species8472

unread,
Dec 24, 2007, 6:16:18 AM12/24/07
to

You can setup a proc as a proxy table and the select from it from your
cursor.

joop

Carl Kayser

unread,
Dec 27, 2007, 10:06:28 AM12/27/07
to

"jimmyc" <jmc...@gmail.com> wrote in message
news:a5a62a6b-24b7-47c2...@a35g2000prf.googlegroups.com...

Hmmmm, I don't quite see your goal. What is it that is being, well, shall I
say, "variableized" in your logic? Is it 'CA', 'MD', "VA', etc? Or the
name of a stored procedure (sp_get_authors)? Or something else? I suspect
that 'execute immediate' can be used to solve your problem ... if you could
be more specific.


Jeff Tallman

unread,
Jan 10, 2008, 11:16:25 PM1/10/08
to

One of the problems here is you would have to designate which result set
from the proc is the one the cursor should cursor over - and then the
result set would have to be fully materialized to a work table -
especially if attempting a scrolling cursor......

....so the only way is suggested below - to use a proxy table mapped to
the proc call as the proxy table effectively maps the expected outputs -
although you have to be careful as it isn't always perfect (i.e.
multiple queries with same result columns).

jimmyc

unread,
Jan 11, 2008, 9:51:27 AM1/11/08
to
My main goal is to be able to use existing stored procs output to feed
into my cursor.
This would save me lots of time and would be very easy maintenance.

No different than using a view..But the power of the business rules in
the SP being abstracted out
would be a huge time saver.

Bottom line:
I want output of an SP to be fed into a CURSOR.

> > joop- Hide quoted text -
>
> - Show quoted text -

0 new messages