in reply to Reusing placeholders
PostgreSQL (or rather, DBD::Pg) allows dollar notation too, so you can re-use those. (Must start at $1, but can be used in any order in the query), see DBD::Pg docs, under 'placeholders'.
I normally set $dbh->{pg_placeholder_dollaronly} property so I don't start using the questionable question mark.
(Of course, if your SQL is submitted to other DBMS than (just) postgres, you'll have to think of something else)
edit: Oh, I see you're also the last_insert_id guy. That means you're mucking around with a lesser db than PostgreSQL and that the above should be ignored till you upgrade to the better system
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Reusing placeholders
by Bod (Parson) on Mar 27, 2021 at 23:26 UTC |