|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now! |
|
#1
|
||||
|
||||
|
Multiple Select Statements in a Stored Procedure?
I know you can place two "select * from table" statements but am not sure how to access the data in the two recordsets. I am using asp as the programming language. Can anyone show me an example of how to do this?
__________________
mr... mike.rusaw@realpage.com RalPage, Inc. "I have made this letter longer than usual, only because I have not had the time to make it shorter." - Blaise Paschal |
|
#2
|
||||
|
||||
|
Are you using ADODB objects to connect to the database? If so, you can perhaps use the NextRecordSet method to move to the next recordset.
http://msdn.microsoft.com/library/e....asp?frame=true
__________________
Up the Irons What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home. "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest Down with Sharon Osbourne Puzzle of the Month solved by sizeablegrin, etienne141 and L7Sqr, superior C/C++ programmers of the month |
|
#3
|
||||
|
||||
|
Only one recordset can be returned. If you need data from two Selects, try joining them or Union'ing them.
-Dave |
|
#4
|
||||
|
||||
|
I have used multiple select statements in stored procedures to return multiple datasets in Sybase and MSSqlserver and retrieved the data (as distinct datasets) in Perl and C++. Just be sure to put enough error handling in your data set retrieval code to cover the cases where you fail to get data due to errors.
__________________
Left DevShed May 28, 2005. Reason: Unresponsive administrators. Free code: http://sol-biotech.com/code/. Secure Programming: http://sol-biotech.com/code/SecProgFAQ.html. Performance Programming: http://sol-biotech.com/code/PerformanceProgramming.html. It is not that old programmers are any smarter or code better, it is just that they have made the same stupid mistake so many times that it is second nature to fix it. --Me, I just made it up The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man. --George Bernard Shaw |
![]() |
| Viewing: Dev Shed Forums > Databases > Database Management > Multiple Select Statements in a Stored Procedure? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|