plpgsql, insert with wariables in function triggered

From: Marcin Mazurek <M(dot)Mazurek(at)poznan(dot)multinet(dot)pl>
To: pgsql-general(at)postgresql(dot)org
Subject: plpgsql, insert with wariables in function triggered
Date: 2000-10-16 16:20:03
Message-ID: 20001016182003.B3386@poznan.mtl.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,
why I can't use tabb variable in INSERT ?
The error message I get is:
ERROR: parser: parse error at or near "$1"

DECLARE
ids1 INTEGER; ids2 INTEGER;
tab TEXT; tabb TEXT;
...
tab := TG_RELNAME;
tabb :=tab || ''_do_zablokowania'';
...
if (NEW.stan=ids1) then
INSERT INTO tabb (zlecenie) VALUES ( OLD.id);
--line that casues the trouble
end if;
...
tia

Marcin Mazurek

--
Kierownik Działu Systemowego
MULTINET SA o/Poznan
http://www.multinet.pl/

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2000-10-16 16:21:01 Re: AW: [HACKERS] My new job
Previous Message Bruce Momjian 2000-10-16 16:18:15 Re: 7.1 Release Date