Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Using vb to retrieve a result set from a stored procedure

Re: Using vb to retrieve a result set from a stored procedure

From: M. Bhatti <mohammed.bhatti_at_mci.com>
Date: Fri, 16 Oct 1998 11:58:31 -0400
Message-ID: <36276D26.949D308@mci.com>


Hugh Pendry wrote:

> hi
>
> Any ideas how Visual Basic could retieve a result set from an oracle
> stored procedure or function
>
> i tried returning a ref cursor from a function but couldn't get vb to
> use
> this
>
> any ideas?
>
> hugh

I know this is how you call an sp from Oracle:

Dim sSQLx as String
Dim sParam as String

sParam = "'" & var1 & "', '"
sParam = sParam & "'" & var2 & "'"

sSQLx = "declare begin sp_Proc(" & sParam & "); end;" db.Execute sSQLx, sParam

I've seen something similar (below) work with MS SQL Server. I would think something similar would work for Oracle too. Dim qdf as QueryDef
dim rs as RecordSet

Set qdf = db.CreateQueryDef("", sSQLx)
' Or you could use the recordset method. Set rs = db.RecordSet(sSQLx, dbReadOnly) ' Open the qdf or rs
...
...

Where sSQLx is defined above and sProc is the sp on the server.

I hope that helps somewhat

mkb Received on Fri Oct 16 1998 - 10:58:31 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US