Re: [SQL] Escaping the $1 parameter in stored procedures
Found a solution: -- my_constraint(0) = turn off constraint -- my_constraint(1) = turn ON constraint CREATE OR REPLACE FUNCTION my_constraint(INTEGER) RETURNS VARCHAR AS ' DECLARE cmd VARCHAR; BEGIN IF $1 = 0 THEN
[SQL] Escaping the $1 parameter in stored procedures
I'm running Postgres 7.3.2 in Redhat 9.0. I'm trying to execute a function below defined as a stored procedure ALTER TABLE tms_schedule DROP CONSTRAINT "$1"; However, postgres thinks the "$1" is a parameter value. How do I tell postgres to treat it as a literal $1? TIA, Robert