in reply to Re: Oracle + Perl + bulk operation?
in thread Oracle + Perl + bulk operation?

I am not sure about those perl modules you guys mentioned, but for Pro*c, it does have equivalent for inserting, and actually also updating and deleting. I attached some examples in C:
char emp_name[50][20]; int emp_number[50]; float salary[50]; /* populate the host arrays */ EXEC SQL INSERT INTO EMP (ENAME, EMPNO, SAL) VALUES (:emp_name, :emp_number, :salary);
And
int emp_number[50]; float salary[50]; /* populate the host arrays */ EXEC SQL UPDATE emp SET sal = :salary WHERE EMPNO = :emp_number;
Even deleting with array:
int emp_number[50]; /* populate the host array */ EXEC SQL DELETE FROM emp WHERE empno = :emp_number;

Replies are listed 'Best First'.
Re: Re: Re: Oracle + Perl + bulk operation?
by perrin (Chancellor) on Dec 17, 2002 at 16:23 UTC
    The answers are all there, but I'll spell them out for you:
    • Use DBI with DBD::Oracle.
    • The fastest way to read an array is with fetchall_arrayref.
    • You may be able to do fast inserts/updates with bind_param_array, but it depends on whether or not DBD::Oracle has implemented special bulk insert code or not. Try it.
    • Setting RowCacheSize may help with large selects.