Hello everyone
Is there a way to use the "host array" interface of oracle 8i in perl dbi?
With arrays, you manipulate an entire array with a single SQL statement.
Thus, Oracle communication overhead is reduced markedly, especially in a
networked environment. A major portion of runtime is spent on network
roundtrips between the client program and the server database. Arrays reduce
the roundtrips.
For example, suppose you want to insert information about 300 employees into
the EMP table. Without arrays your program must do 300 individual
INSERTs--one for each employee. With arrays, only one INSERT needs to be
done. Or you want to select many records from the database.
For example: With embedded SQL in C you can do the following:
-------------------------------------------------------------
char emp_name[1000];
int emp_number[1000];
float salary[1000];
EXEC SQL SELECT ENAME, EMPNO, SAL
INTO :emp_name, :emp_number, :salary
FROM EMP
WHERE SAL > 2000;
--------------------------------------------------------------
All data (maximum 1000) will come in one stream over the network to your
client.
I have tried the select with the "fetchall_arrayref" in perl, but behind the
scenery multiple fetches are produced and there is no reduce of roundtrips
between the client and the database.
Thanks,
Peter