In pgadmin3, I would like to use parameterized queries (to faster debugging, just copy & paste the query from my php file). But I haven't found an option to add the values of the $1
, $2
... parameters. Is it possible?
This is the query I'm building in a loop, following the suggestion for NULL testing from here:
SELECT EXISTS(SELECT 1
FROM tax
WHERE (addby=$1 or addby<>$1)
AND (adddate=$2 or adddate<>$2)
AND ($3 IS NULL AND nome IS NULL OR nome=$3)
AND ($4 IS NULL AND rank IS NULL OR rank=$4)
AND ($5 IS NULL AND pai IS NULL OR pai=$5)
AND ($6 IS NULL AND valido IS NULL OR valido=$6)
AND ($7 IS NULL AND sinonvalid IS NULL OR sinonvalid=$7)
AND ($8 IS NULL AND espec IS NULL OR espec=$8)
AND ($9 IS NULL AND public IS NULL OR public=$9)
);
Notice that substitute all parameters by hand is tedious, error-prone and probably (I hope) unnecessary.
Thanks in advance.