Re: Multiple Recordset from a Stored Procedure
- From: "Lyle Fairfield" <lylefairfield@xxxxxxx>
- Date: 9 Dec 2005 04:09:11 -0800
I know zip about Oracle and zip + 1 / infinity about multiple
recordsets but I am so interested that I couldn't resist the search
myself:
I came upon:
http://www.oracle.com/technology/sample_code/tech/windows/ole_db/oledb8/index.html
Returning multiple recordsets from a stored procedure[13-Mar-2003]
This sample shows how to return multiple recordsets from database
stored procedure using ActiveX Data Objects (ADO) with VB
Download Now (ZIP, 103KB)
Also I note that ADO help suggests that we can roll our own multiple
recordset returning command as:
"If you open a Recordset object based on a compound command statement
(for example, "SELECT * FROM table1;SELECT * FROM table2") using the
Execute method on a Command or the Open method on a Recordset, ADO
executes only the first command and returns the results to recordset.
To access the results of subsequent commands in the statement, call the
NextRecordset method."
And I experimented with MS-SQL as follows:
Dim r As ADODB.Recordset
Dim r2 As ADODB.Recordset
Set r = CurrentProject.Connection.Execute( _
"SET NOCOUNT ON " _
& "SELECT * FROM FFDBATransactions " _
& "COMPUTE AVG(TotalAmount)")
Set r2 = r.NextRecordset
Debug.Print r.GetString(adClipString, 1, vbTab, vbNewLine)
Debug.Print r2.GetString(adClipString, 1, vbTab, vbNewLine)
Set r = Nothing
which gives:
1 2004-01-01 Carryover from 2003 7290.07 17 1 11
591.5508
And I'm going to ask a question about multiple recordsets and no count
in a separate thread.
.
- References:
- Re: Multiple Recordset from a Stored Procedure
- From: Lyle Fairfield
- Re: Multiple Recordset from a Stored Procedure
- From: Scott Remiger
- Re: Multiple Recordset from a Stored Procedure
- From: Lyle Fairfield
- Re: Multiple Recordset from a Stored Procedure
- From: Terry Kreft
- Re: Multiple Recordset from a Stored Procedure
- From: Thelma Lubkin
- Re: Multiple Recordset from a Stored Procedure
- From: Terry Kreft
- Re: Multiple Recordset from a Stored Procedure
- From: Randy Harris
- Re: Multiple Recordset from a Stored Procedure
- From: Terry Kreft
- Re: Multiple Recordset from a Stored Procedure
- From: Randy Harris
- Re: Multiple Recordset from a Stored Procedure
- Prev by Date: Re: Multiple Recordset from a Stored Procedure
- Next by Date: SET NOCOUNT ON; Multiple Recordsets; ADO Command Text
- Previous by thread: Re: Multiple Recordset from a Stored Procedure
- Next by thread: Re: From ListBox to Subform -- , how to add SQL statement?
- Index(es):
Relevant Pages
|