Re: bind_param_inout
From: Steven Lembark (lembark_at_wrkhors.com)
Date: 10/21/04
- Next message: Peter J. Holzer: "Re: Slow connection to Oracle 9i"
- Previous message: Tim Bunce: "Re: DBD::Oracle 1.15 core dump if RETURNING clause is used with LOB"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 21 Oct 2004 12:51:40 -0400 To: dbi-users@perl.org
> I wonder ... how about adding a method bind_params() like this:
>
> sub bind_params {
> my $sth = shift;
> my $pos = (ref($_[0]) ? 1 : shift);
> for my $param (@{$_[0]}) {
> $sth->bind_param($pos++, $param);
> }
> }
>
> So that this could be shortened to
>
> $sth->bind_params(\@execute_args); # default position is 1
> $sth->bind_param_inout($#execute_args+1,\$new_id,38);
>
> I know I can have the loop in the script, but this looks kinda more
> readable to me.
>
> Sorry if this was already rejected ;-)
I've already posted a working version of this to the list,
if you like I can send you a copy to test.
-- Steven Lembark 85-09 90th Street Workhorse Computing Woodhaven, NY 11421 lembark@wrkhors.com 1 888 359 3508
- Next message: Peter J. Holzer: "Re: Slow connection to Oracle 9i"
- Previous message: Tim Bunce: "Re: DBD::Oracle 1.15 core dump if RETURNING clause is used with LOB"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|