Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cursor output of stored procedure

Status
Not open for further replies.

nnmmss72

Programmer
May 14, 2006
110
IR
I need to write a stored procedure which it's output be a recordset or cursor, this cursor should be made manually after proccessing on a few other cursors, is it possible
 
Yes

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
can you give a sample or a reference i can read it?

thanks
 
It would be better if you gave more details regarding what you are attempting to do.

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
to some reason i have to create a recordset manually like what we can do in visual basic . for example
Set rstP = New ADODB.Recordset
rstP.CursorLocation = adUseClient
rstP.Fields.Append "PrjId", adDouble
rstP.Fields.Append "PrjName", adVarChar, 255
rstP.Open
rstP.AddNew
rstP("PrjId") = PrjId
rstP("PrjName") = PrjName
rstP.Update
now i have to create a recordset or cursor manually and it should be send back as a output, the can't define as normal defining cursor something like this
declare Total_Quantity Cursor
For SELECT * FROM dbo.VIEW_PV WHERE (dbo.VIEW_PV.PrjId = @ProjId)

because i have to process on a few recordset or cursor and the result should be made from them as new cursor. now can make cursor manually like a recordset that i did above?
 
manual cursor can be prepared in vb but not in sqlserver.

better learn about disconnected recrodsets and how to receive multiple recordsets from single comand.

for details look for
activeconnection and nextrecordset in vb help.
 
If I understand correctly, you want to manually create a recordset and return the values. If so, then...

Code:
Set NoCount on

Declare @Temp Table(PrjId Float, PrjName VarChar(255))

Insert Into @Temp Values(1, 'Project1')
Insert Into @Temp Values(2, 'Another Project')
Insert Into @Temp Values(3, 'Yet another project')

Select * from @Temp

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top