$dbh->quote_identifier is the portable version of escape_name
my $table = 'sometable'; my @cols = qw( id name ); my @vals = qw( 3 somename ); my $stmt = "INSERT INTO " . $dbh->quote_identifier($table) . " (" . join(', ', map { $dbh->quote_identifier($_) } @cols) . ") VALUES (" . join(', ', (?) x @cols) . ")"; my $sth = $dbh->prepare($stmt); $sth->execute(@vals);
In reply to Re^2: variable type
by ikegami
in thread variable type
by Losing
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |