Im posting this for the third time now. It seems that hardly anyone uses the "new" features of oracle 8. If you do - please answer this:
Did you ever succeed in passing an array of variables to an oracle stored procedure? This operation should be possible since oracle 8 and mdac 2.5. Its not that urgent but i'd like to know whats wrong over here - I'm attaching a sample of code that doesn't work to make clear what i'm trying to reach...
Dim CON As New ADODB.Connection
Dim QSQL As String
Dim COM As New ADODB.Command
Dim Param1 As ADODB.Parameter
Dim RS As New ADODB.Recordset
Dim a(255) As Integer, i As Long
' Connect Database
CON.ConnectionString = "provider=MSDAORA;DATA SOURCE=x;USER ID=y;PASSWORD=z"
CON.CursorLocation = adUseServer
CON.Open
' Prepare stored procedure
COM.ActiveConnection = CON
COM.CommandText = "package.ProcName"
COM.CommandType = adCmdStoredProc
' Prepare parameters
Set Param1 = COM.CreateParameter("Input", adArray Or adInteger, adParamInput)
COM.Parameters.Append Param1
For i = 1 To 255
a(i) = i
Next i
COM.Parameters(0).Value = a
' Execute Procedure
RS.CursorLocation = adUseServer
RS.CursorType = adOpenKeyset
RS.LockType = adLockReadOnly
Set RS = COM.Execute
The procedure is defined like this:
TYPE T_NumList IS VARRAY(255) OF NUMBER;
PROCEDURE ProcName(ar IN T_NumList);
This throws a: Type name is invalid
Any help is appreciated - thanx
Did you ever succeed in passing an array of variables to an oracle stored procedure? This operation should be possible since oracle 8 and mdac 2.5. Its not that urgent but i'd like to know whats wrong over here - I'm attaching a sample of code that doesn't work to make clear what i'm trying to reach...
Dim CON As New ADODB.Connection
Dim QSQL As String
Dim COM As New ADODB.Command
Dim Param1 As ADODB.Parameter
Dim RS As New ADODB.Recordset
Dim a(255) As Integer, i As Long
' Connect Database
CON.ConnectionString = "provider=MSDAORA;DATA SOURCE=x;USER ID=y;PASSWORD=z"
CON.CursorLocation = adUseServer
CON.Open
' Prepare stored procedure
COM.ActiveConnection = CON
COM.CommandText = "package.ProcName"
COM.CommandType = adCmdStoredProc
' Prepare parameters
Set Param1 = COM.CreateParameter("Input", adArray Or adInteger, adParamInput)
COM.Parameters.Append Param1
For i = 1 To 255
a(i) = i
Next i
COM.Parameters(0).Value = a
' Execute Procedure
RS.CursorLocation = adUseServer
RS.CursorType = adOpenKeyset
RS.LockType = adLockReadOnly
Set RS = COM.Execute
The procedure is defined like this:
TYPE T_NumList IS VARRAY(255) OF NUMBER;
PROCEDURE ProcName(ar IN T_NumList);
This throws a: Type name is invalid
Any help is appreciated - thanx