in reply to Re^5: RFC: Placeholder creation for SQL statements
in thread RFC: Placeholder creation for SQL statements
That post is long enough, so I won't edit it to add new things :).
I just realized, among the advantages of the ph BLOCK [HASH] version (syntax that looks like the other command BLOCK PARAMS, not having to parse the opcode, access pads or lexicals out of their scope), it also means you don't need that rule with the leading _, just use any variable that's not %_:
my %default = (rank => "Bishop"); $dbh->xprepare(ph { "SELECT * FROM $table WHERE rank = $_{rank} AND le +ngth(username) = 4" } %default)->execute(rank => "Prior");
I'll give it a try tomorrow, but I think that should be fairly easy to implement.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: RFC: Placeholder creation for SQL statements
by LanX (Saint) on Mar 10, 2018 at 02:22 UTC |