Re: DBI / DBD and array data types

Hildo Biersma <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.sybase.devel
Organization Morgan Stanley
Message-ID <[email protected]>
I'm not sure this is the same thing.

Both DB2 and Oracle support "array inserts" and "array updates", where 
an insert or update statement is executed with a list of values - i.e. 
it is a more efficient way of executing the same insert/update multiple 
times with a different list of values every time.  AFAIK, that's what 
the bind_param_array() and execute_array() methods are used for.  I am 
not sure whether DBD::DB2 currently supports this feature.

I'm talking about a different feature, where a single parameter to a 
stored procedure, which will be executed a single time, is given a 
variable-sized array of values (i.e. an array datatype).  An example 
would be a stored procedure with a signature like

   CREATE PROCEDURE inArray (IN input IntArray)

I think PostgreSQL supports the same feature, but I may be wrong.

Anyway, that's what I'm looking for, not the bind_param_array() and 
execute_array() methods.

Hildo


[email protected] wrote:
> DBD::Oracle supports it
> 
> if you mean this
> 
> $sth->bind_param_array(1,\@in_values);
> $sth->bind_param_inout_array(2,\@out_values,0,{ora_type => ORA_VARCHAR2});
> $sth->execute_array({ArrayTupleStatus=>\@status});
> 
> in this case I am binding an array in and also binding an array on the way
> out and I use the execute_array to do it.
> 
> 
> No sure if DBD::Oracle will help much is it is useing OCI on the back end.
> 
> Cheers
> 
>> Current releases of DB2 support an array datatype, where a list of
>> values is passed as a single parameter.  The current release of DBD::DB2
>> does not support this.
>>
>> Does anyone know of DBD drivers for other databases that implement an
>> array datatype and that I could use as an example?
>>
>> Cheers, Hildo
>>
> 
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.