Need help passing an array to an Oracle procedure using Oracle Objects for OLE 
Author Message
 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.



Tue, 04 Aug 1998 03:00:00 GMT  
 Need help passing an array to an Oracle procedure using Oracle Objects for OLE

Quote:
>There doesn't appear to be an OraParameter of the appropriate data type,
>[for passing an array to an Oracle procedure stored on a remote database]
>I have the annoying sense that I'm missing somthing obvious and that I should
>be cutting eye-holes out of a paper bag.

The answer to this was obvious, but I had to stop thinking about it to see my
mistake.  
Arrays can not be passed by reference between a client and a server.
This is a job for a global object reference mechanism (CORBA, etc.), and is
not something I'm going to get around in Visual Basic.


Thu, 13 Aug 1998 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How to pass an integer array/userdef type array into an Oracle Stored procedure

2. Need help with initalizing objects. Oracle OLE

3. Passing Array as Input Parameter to Oracle Stored Procedure

4. Passing Array's into Oracle Stored Procedures

5. Passing Array as Input Parameter to Oracle Stored Procedure

6. Passing an Array to Oracle Stored Procedure from VB6

7. Connecting to Oracle thru Oracle OLE DB Provider(OraOLDDB.Oracle)

8. Unable to connect Oracle using the Microsoft OLE DB Provider for Oracle

9. Oracle stored procedure and input arrays using ADO and VB6

10. Unable to execute Oracle Procedure using Ado2.5 - using synonyms for procedures

11. Using ADO with Oracle Object for OLE

12. Using ADO with Oracle Object for OLE

 

 
Powered by phpBB® Forum Software