in reply to Re: A Case with 5 Var's
in thread A Case with 5 Var's
What kind of query? If you want to generate an SQL query from a hash, there is SQL::Abstract, which does just that:
use strict; use SQL::Abstract; my $sql = SQL::Abstract->new; my $table = 'customers'; my @fields = qw(name vorname plz tel); # You shouldn't have $name, $vorname etc. but a hash # containing the things you want: my %where = ( name => $name, vorname => $vorname, ); my ($stmt, @bind) = $sql->select($table, \@fields, \%where); print <<EOM; -- I use the following SQL: $stmt -- with the following placeholders @bind
|
---|
Replies are listed 'Best First'. | |
---|---|
A reply falls below the community's threshold of quality. You may see it by logging in. |