Thanks,
T.
_
Organizza le tue feste e condividine le foto con Windows Live Eventi!
http://home.services.spaces.live.com/events/
Tiziano Slack wrote:
Thanks for the precious tips, but unfortunately the syntax:
EXECUTE 'INSERT INTO '|| TG_TABLE_NAME ||' SELECT '|| NEW.*;is parsed
correctly, but when the trigger is fired the following error is returned
ERROR: column "*" not found in data type mytable
CONTEXT: SQL stateme
Thanks for the precious tips, but unfortunately the syntax:
EXECUTE 'INSERT INTO '|| TG_TABLE_NAME ||' SELECT '|| NEW.*;is parsed
correctly, but when the trigger is fired the following error is returned
ERROR: column "*" not found in data type mytable
CONTEXT: SQL statement "SELECT 'INSERT INT
o Slack <[EMAIL PROTECTED]>
Date: Feb 5, 2008 2:15 PM
Subject: [SQL] TG_TABLE_NAME as identifier
To: pgsql-sql@postgresql.org
Hello everybody! I'm newbie to plpgsql syntax. Can anyone tell where I'm
getting wrong?
CREATE OR REPLACE FUNCTION tr_audit() RETURNS TRIGGER AS $tr_aud
Tiziano Slack wrote:
Hello everybody! I'm newbie to plpgsql syntax. Can anyone tell where
I'm getting wrong?
INSERT INTO TG_TABLE_NAME SELECT NEW.*;
If you need to build a dynamic query with plpgsql you'll need to
assemble it as a string and use EXECUTE. You can use variables in
comparison
Hello everybody! I'm newbie to plpgsql syntax. Can anyone tell where I'm
getting wrong?
CREATE OR REPLACE FUNCTION tr_audit() RETURNS TRIGGER AS $tr_audit$
BEGIN
IF (TG_OP = 'UPDATE') THEN
...
NEW.id = nextval(TG_TABLE_NAME || '_id_seq'::regclass);
INSERT INTO