adrive has asked for the wisdom of the Perl Monks concerning the following question:
guys, is it even possible to bind an sql string with arrays?
i need to do something like
but of course it didn't work. How would be the best way to do this? I don't want to pass my parameters directly into my sql strings.my @userArray = qw(batman, robin, joker); my $sql = "select * from tablename where username IN ?"; $stmt=$dbConn->prepare($sql); $stmt->bind_param(1,@userArray); $stmt->execute();
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: DBD::Oracle 's DBI binding of arrays
by runrig (Abbot) on Sep 21, 2007 at 05:06 UTC | |
by andreas1234567 (Vicar) on Sep 21, 2007 at 08:37 UTC | |
Re: DBD::Oracle 's DBI binding of arrays
by duff (Parson) on Sep 21, 2007 at 04:16 UTC | |
Re: DBD::Oracle 's DBI binding of arrays
by adrive (Scribe) on Sep 21, 2007 at 06:49 UTC | |
Re: DBD::Oracle 's DBI binding of arrays
by adrive (Scribe) on Sep 21, 2007 at 06:16 UTC | |
by Corion (Patriarch) on Sep 21, 2007 at 06:40 UTC | |
by bibliophile (Prior) on Sep 21, 2007 at 13:53 UTC |
Back to
Seekers of Perl Wisdom