Frank W Holt Jr
4/10/2002 3:35:00 PM
Hello,
I'm attempting to create an OdbcDataReader from an Oracle 8i Stored
Procedure. The error I'm getting is:
'Syntax Error or Access Violation'
I can get it to work using the same code with OleDB just fine. I realize I'm
probably not using the correct syntax.. I would greatly appreciate any help
on this...
-----------------------------------------------------
The Procedure declaration is:
PROCEDURE FETCH_C130s
(p_vcWHEREClauase VARCHAR2,
p_vcORDERClause VARCHAR2,
p_curResultSet OUT CURSOR_TYPE);
The 'CURSOR_TYPE' is a 'REF CURSOR'.
-------------------------------------------------------
My Calling Code (in VB.NET) is:
Dim dr As OdbcDataReader
Dim con As OdbcConnection
Dim cmd As OdbcCommand
con = New OdbcConnection(<ODBC DSN Connection String>)
cmd = New OdbcCommand()
With cmd
.CommandText = "{Call <SchemaName>.<PackageName>.FETCH_C130s(?, ?,
{resultset 0, p_curResultSet})}")
.CommandType = CommandType.Text
Dim param As OdbcParameter = .Parameters.Add("p_vcWHEREClause",
OdbcType.VarChar)
param.Value = ""
param.Direction = ParameterDirection.Input
param = .Parameters.Add("p_vcORDERClause", OdbcType.VarChar)
param.Value = ""
param.Direction = ParameterDirection.Input
End With
Try
con.Open()
Catch
'Handle connection errors here
End Try
Try
dr = cmd.ExecuteReader(CommandBehavior.CloseConnection)
Catch
'Handle SP call errors here
End Try
-------------------------------------------------------
TIA
-frank