If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Can you assign the select result of a stored procedure as a value?

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-07-09, 05:11
mind_grapes mind_grapes is offline
Registered User
 
Join Date: Jun 2009
Location: Midlands
Posts: 133
Can you assign the select result of a stored procedure as a value?

Hi all, hope you can help.

I was wondering if it is possible to assign the search result of a stored procedure as a value?

what i mean is, is it possible to do something like this?:

dim sSQL

sSQL = "exec spGetUserName"
SET oRS = oDB.Execute(sSQL)
If Not oRS.EOF then
reponse.write("nothing")

with a stored procedure of:
ALTER PROCEDURE [dbo].[spGetUserName]

AS
BEGIN
SET NOCOUNT ON;
SELECT
username
FROM
tblusers

END

The above exmaple is probably wrong, but hope i have explained myself properly.

Regards
MG
Reply With Quote
  #2 (permalink)  
Old 10-07-09, 19:28
gvee gvee is offline
www.gvee.co.uk
 
Join Date: Jan 2007
Location: UK
Posts: 10,002
Mais oui!

I think we've covered this before... Is this possible / how can it be done?

Ideally you want to use nothing but sprocs to access your data, so you are definately on the right tracks!
__________________
George
Twitter | Blog
Reply With Quote
  #3 (permalink)  
Old 10-09-09, 07:29
mind_grapes mind_grapes is offline
Registered User
 
Join Date: Jun 2009
Location: Midlands
Posts: 133
Hi gvee, thank you for the reply.

I couldn't remember if i had, I've been away on holiday and have had to pick it up again after a number of weeks, sorry for asking the same question twice.

I have to be honest, I still cant work out how to do it even when people say im on the right lines, I struggle to see them.

I'll read everything over again.

Regards
MG
Reply With Quote
  #4 (permalink)  
Old 10-09-09, 08:38
gvee gvee is offline
www.gvee.co.uk
 
Join Date: Jan 2007
Location: UK
Posts: 10,002
No problemo!
Give it a go and if you can't get it to work, post back your code highlighting any error lines/messages that you recieve and we can most likely help
__________________
George
Twitter | Blog
Reply With Quote
  #5 (permalink)  
Old 10-09-09, 10:25
mind_grapes mind_grapes is offline
Registered User
 
Join Date: Jun 2009
Location: Midlands
Posts: 133
Hi, you're too kind, I will have and go hopefully i can make some head way, or at least add my thoughts / code to help resolve the issue.

Regards
MG
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On