
Need help passing an array to an Oracle procedure using Oracle Objects for OLE
I've created an Oracle procedure which uses and array as an input
variable, and another for output. In the past, I've successfully passed
OraParameters, VB variables, and VB tables (user-defined data types) to
Oracle procedures. I can even pass individual elements of an array,
individually, Thus:
'
'----- Build PL/SQL statement ----------------------------------------
'
SQL_GLB$ = "begin get_serv_pkg.get_serv("
SQL_GLB$ = SQL_GLB$ & 100 & ","
For x = 1 to 100
SQL_GLB$ = SQL_GLB$ & "'" & GeoKeyArrayIn(x) & "'" & ","
Next x
For y = 1 to 99
SQL_GLB$ = SQL_GLB$ & "'" & GeoKeyArrayOut(y) & "'" & ","
Next y
SQL_GLB$ = SQL_GLB$ & GeoKeyArrayOut(y)
SQL_GLB$ = SQL_GLB$ & "); end;"
'
'----- Process statement ---------------------------------------------
'
RowsEffected% = MCS_DB_GLB.DbExecuteSQL(SQL_GLB$)
The value of SQL_GLB$ is somthing like this:
begin get_serv.pkg.get_serv(100,'xxx','lkds','ioup','etc...'); end;
But I want to pass the entire array as a host variable to the
corresponding array created in the Oracle procedure.
The value of SQL_GLB$ should look like this:
begin get_serv.pgk.get_serv(100, GeoKeyIn(), GeoKeyOut()); end;
..only the references to the arrays should be swapped for the proper
syntax, since mine is obviously wrong.
There doesn't appear to be an OraParameter of the appropriate data type,
and the only other tactic I can imagine would be to pass some kind of
table object or other recordset (which seems dubious). I have the
annoying sense that I'm missing somthing obvious and that I should be
cutting eye-holes out of a paper bag.