Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsOtherProgramming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old October 6th, 2004, 06:18 AM
xcellent xcellent is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 4 xcellent User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
Reply

Viewing: ASP Free ForumsOtherProgramming Help > how to Get a record set(cursor) in asp code from a procedure


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT