|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
how to Get a record set(cursor) in asp code from a procedure
Hi,
this is the very first time i am posting a problem here. Do hope that will find some solution. i am using a sql procedure that returns a cursor (records/rows). the problem is, i dont know how to get that rows/rs in asp code. The procedure definition is as follows. CREATE PROCEDURE opnBalanceProducts @catId INT = -1, @distId INT, @productsRS CURSOR VARYING OUTPUT AS IF @catId = -1 BEGIN SET @productsRS = CURSOR FORWARD_ONLY STATIC FOR SELECT pro.pro_title, pro.pro_id,dp.pd_price FROM tblDistProducts as DP RIGHT OUTER JOIN tblProducts as pro ON DP.pd_proId = pro.pro_id WHERE (DP.pd_distId = @distId) AND DP.pd_proId NOT IN (SELECT proId FROM tempOpnUnits WHERE distId = @distId) print 'no category' END ELSE BEGIN SET @productsRS = CURSOR FORWARD_ONLY STATIC FOR SELECT pro.pro_title, pro.pro_id,dp.pd_price FROM tblDistProducts as DP RIGHT OUTER JOIN tblProducts as pro ON DP.pd_proId = pro.pro_id WHERE (DP.pd_distId = @distId) AND (pro.pro_catId = @catId ) AND DP.pd_proId NOT IN (SELECT proId FROM tempOpnUnits WHERE distId = @distId) END OPEN @productsRS GO in the asp code, i am calling the procedure as follows set distId = myCom.createParameter ("@distId",adInteger,adParamInput,,sessDistId) set catId = myCom.createParameter ("@catId",adInteger,adParamInput,,categoryId) set productsRS = myCom.createParameter ("@productsRS",?(what type to use here),adParamOutput) problem is here. its the output, how can i get it... myCom.parameters.append = catId myCom.parameters.append = distId myCom.parameters.append = productsRS myCom.Execute waiting for some solution regards |
![]() |
| Viewing: ASP Free Forums > Other > Programming Help > how to Get a record set(cursor) in asp code from a procedure |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|