Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: DBI variable argument count

by NetWallah (Canon)
on Sep 13, 2012 at 22:27 UTC ( #993592=note: print w/replies, xml ) Need Help??

in reply to DBI variable argument count

Try this: (pseudocode)
my $sth = $dbh->prepare( $sql ); my @var_args = ($bar); # if at least one arg if (Some-condition){ push @var_args, $baz; # others, as needed } $sth->execute( @var_args );
Update: Corrected declaration of my @var_args

             I hope life isn't a big joke, because I don't get it.

Replies are listed 'Best First'.
Re^2: DBI variable argument count
by anothersmurf (Novice) on Sep 13, 2012 at 22:41 UTC

    I see. I must have messed something up when I tried to pass an array to execute() instead of the individual comma-delimited scalars.

    Thank you.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://993592]
[marto]: just a security event, they have people from the 'corporate' security, external security companies, the police etc
[marto]: perhaps I'll get the time to pin down some of the corporate security people, since they refuse to answer any questions
[marto]: for our system, the windows pre production domains alone require 490 accounts :/
[marto]: they don't have a password management solution, and we're not supposed to write any of this down
Discipulus boring meeting time.. ;=(
[choroba]: marto do you really remember 490 different passwords?! :-o

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2017-11-22 10:27 GMT
Find Nodes?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:

    Results (317 votes). Check out past polls.