Oracle Objects for OLE
Release 9.2

Part Number A95895-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents

Master Index

Feedback

Array Processing

OO4O supports an array interface to an Oracle database through OraParamArray object. The array interface enables the transfer of bulk of data in single network trip. This is especially helpful while processing a PL/SQL or SQL statement via the ExecuteSQL or CreateSQL method. For example, in order to insert 100 rows into remote database without array processing, ExecuteSQL/CreateSQL must be called for 100 times, which in turn make 100 network trips. For example:

For I = 1 to 100

OraParameter("EMPNO").Value = xxxx

OraParameter("ENAME").Value = 'yyyy'

OraParameter("DEPTNO").Value = zz

OraDatabase.ExecuteSql("insert into emp values

(:EMPNO,:ENAME,:DEPTNO)");

Next I

The following example make use of arrays and do only one network trip.

' :ENAMEARR,:EMPNOARR,:DEPTNOARR are parameter arrays

For I = 1 to 100

OraParameter("EMPNOARR").Put_Value xxxx, I

OraParameter("ENAMEARR").Put_Value 'yyyy' ,I

OraParameter("DEPTNOARR").Put_Value zz, I

Next I

'Now call the ExecuteSQL only once

OraDatabase.ExecuteSql("insert into emp

values(:EMPNOARR, :ENAMEARR, :DEPTNOARR)");

For more information on using arrays , see the OraParamArray object.


 
Oracle
Copyright © 1994, 2002 Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents

Master Index

Feedback