Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Re: Re: DBI execute() args in array format (or similar) possible?

by aufrank (Pilgrim)
on Aug 12, 2002 at 20:27 UTC ( #189624=note: print w/replies, xml ) Need Help??


in reply to Re: Re: DBI execute() args in array format (or similar) possible?
in thread DBI execute() args in array format (or similar) possible?

apparently I was very wrong... any problems I had previously were simply a result of my own insuffiencies. I had always assumed this to be the case, but I mentioned my problems because the only solution I came to when I couldn't get placeholders to work was to take them out and thought the original poster might come to a similar place.

The problems I was referring to were with using DBI and the ODBC DBD to perform UPDATE statements on MS Access DBs using placeholders. I just wrote up a test statement, though, and had no problems. Sorry to pass bogus information, perhaps this code can help the original poster anyway...

my @updates = map {$dbh->quote_identifier($_) . ' = (?)'} ('call 1 com +ment', 'call 2 comment', 'call 3 comment', 'call 4 comment'); my $name_field = $dbh->quote_identifier('last name'); my $update_string = join ", ", @updates; my $sql = qq{UPDATE $table SET $update_string WHERE $name_field = (?)} +; print "$sql\n"; my $sth = $dbh->prepare_cached($sql); $sth->execute('foo','bar','baz','qux','smith');

I was thoroughly wrong, but maybe the code will end up helping where my previous post couldn't :)
--au

  • Comment on Re: Re: Re: DBI execute() args in array format (or similar) possible?
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://189624]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2022-12-01 17:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?