#prepare my $sth = $dbh->prepare('SELECT * FROM people WHERE lastname = ? AND f +irstname = ?'); #execute with list of bindvars $sth->execute( $lastname, $firstname ); [download] But it's a bit cumbersome to adjust the bind values if the order chang +es.
Re placeholders: PostgreSQL's DBD::Pg has an attribute 'pg_placeholder_dollaronly' which when set to 1 makes placeholdering (ordering or repeating) a little easier (fsvo easy):
$dbh->{pg_placeholder_dollaronly} = 1; # default is 0 my $sth = $dbh->prepare('SELECT * FROM people WHERE lastname = $1 AND +firstname = $2');
In reply to Re: RFC: Placeholder creation for SQL statements
by erix
in thread RFC: Placeholder creation for SQL statements
by LanX
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |