Re: Cursors... what's the alternative?
From: BobMcClellan (bobmcc_at_tricoequipment.com)
Date: 03/24/04
- Next message: Russ: "Re: trigger looping"
- Previous message: Aaron Bertrand [MVP]: "Re: How can I dump stored procedure results into a temp table?"
- In reply to: Richard J: "RE: Cursors... what's the alternative?"
- Next in thread: Joe Celko: "Re: Cursors... what's the alternative?"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 24 Mar 2004 14:27:50 -0500
Richard,
first of all.. thanks for the reply....
my reason for the cursor is so i can use the recordset.
...
you say to generate a recordset in the stored procedure....
I was doing this via ado prior to opting to handle it entirely inside the
stored procedure
and was using the ado recordsets but how do you open a recordset inside the
stored procedure....
could you please provide a brief example of what the code would look like.
--------------------------------------------------------------------------
from the Front End .... i was using something like. . .
Dim rs As ADODB.Recordset
Set rs = CurrentProject.Connection.Execute("RS_slsMnByJob_MarkedForPrnt")
rs.MoveFirst
While Not rs.EOF
MsgBox rs.Fields("LastName")
rs.MoveNext
Wend
Set rs = Nothing
--------------------------------------------------------------------------
If i could open recsets in the sp and loop
that would work for me... i just thought it was accomplished by using a
cursor.
thanks in advance,
bob....
"Richard J" <anonymous@discussions.microsoft.com> wrote in message
news:56656FB5-9B11-4089-AB04-65EFD554BDE4@microsoft.com...
> Bob,
>
> Well, without getting to involved in reading your stored procedure, one
alternative to cursors is to simply generate a recordset in the stored
procedure and once returned to the application, loop through the returned
recordset and do whatever business logic necessary on each record.
>
> Hope this provides a little food for thought.
- Next message: Russ: "Re: trigger looping"
- Previous message: Aaron Bertrand [MVP]: "Re: How can I dump stored procedure results into a temp table?"
- In reply to: Richard J: "RE: Cursors... what's the alternative?"
- Next in thread: Joe Celko: "Re: Cursors... what's the alternative?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|