Discussion:
DBI, execute_array
(too old to reply)
Bjorge Solli
2006-07-06 10:52:29 UTC
Permalink
Hi all.

Example code:
$dbh->bind_param_array(1, \@array_of_foo_values, \%attr);
$dbh->bind_param_array(2, \@array_of_bar_values, \%attr);
$sth->execute_array(\%attr)

I am trying to understand this example. I don't understand how the attr hash
is supposed to be buildt, but I guess it is supposed to (for the case of
mysql at least) contain something like SQL_VARCHAR and similar.

I found the example here:
http://search.cpan.org/src/TIMB/DBI_AdvancedTalk_2004/tsld077.htm

Hope someone can help or direct me to a more comprehensive DBI tutorial on the
web.

Thanks!
--
Bjørge Solli - Office:+47 55205847
Mohn-Sverdrupsenteret, Nansensenteret, Høyteknologisenteret T47
Thormöhlensgate 47, 5006 Bergen, Norway - www.nersc.no
Google Earth: www.nersc.no/GE - TOPAZ: topaz.nersc.no
Paul Lalli
2006-07-06 14:27:45 UTC
Permalink
Post by Bjorge Solli
$sth->execute_array(\%attr)
I am trying to understand this example. I don't understand how the attr hash
is supposed to be buildt, but I guess it is supposed to (for the case of
mysql at least) contain something like SQL_VARCHAR and similar.
What makes you think that?
Post by Bjorge Solli
http://search.cpan.org/src/TIMB/DBI_AdvancedTalk_2004/tsld077.htm
Before you dig into examples, try reading the actual documentation for
the methods you're trying to use.
http://search.cpan.org/~timb/DBI-1.51/DBI.pm#execute_array

Once you've read that, and read what values belong in %attr, if you
still don't understand, ask again.

Paul Lalli
u***@DavidFilmer.com
2006-07-06 18:50:34 UTC
Permalink
Post by Bjorge Solli
Hope someone can help or direct me to a more comprehensive DBI tutorial on the
web.
Check out Chapter 13 of the excellent book "Beginning Perl" by Simon
Cozens, which starts with DBM and then goes into DBI. You may read the
chapter (and the entire book) online for free at
http://learn.perl.org/library/beginning_perl
--
David Filmer (http://DavidFilmer.com)
Loading...