Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Using vb to retrieve a result set from a stored procedure
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