in reply to joining tables with SQL::Abstract
my($stmt2, @bind2) = $sql->select("users, drivers", ["users.username"], { "drivers.name" => "John", "users.userid" => \"= drivers.userid"} ); print Dumper(\$stmt2, \@bind2); # produces: $VAR1 = \'SELECT users.username FROM users, drivers WHERE ( drivers.na +me = ? AND users.userid = drivers.userid )'; $VAR2 = [ 'John' ];
Update: It is documented, but it should be given it's own section and title so that it stands out more.
Finally, sometimes only literal SQL will do. If you want to include literal
SQL verbatim, you can specify it as a scalar reference, namely:
my $inn = 'is Not Null';
my %where = (
priority => { '<', 2 },
requestor => \$inn
);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: joining tables with SQL::Abstract
by citromatik (Curate) on Jun 25, 2008 at 11:27 UTC | |
by larryl (Monk) on Nov 19, 2008 at 17:32 UTC |