Skip site navigation (1) Skip section navigation (2)

Trigger calling a function HELP ME! (2)

From: <abief_ag_-postgresql(at)yahoo(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Trigger calling a function HELP ME! (2)
Date: 2004-04-21 15:16:05
Message-ID: 20040421151605.77039.qmail@web13901.mail.yahoo.com (view raw or flat)
Thread:
Lists: pgsql-sql
Sorry. I realize I slipped an error in my code:
 
 the code is:
 ---
  CREATE TABLE public.imp_test
  (
    id int8,
    value text
  ) WITHOUT OIDS;
  
  CREATE OR REPLACE FUNCTION public.imp_test_to_out_test(imp_test)
    RETURNS imp_test AS
  'begin
   return $1;
 end;'
    LANGUAGE 'plpgsql' STABLE;
  
  CREATE OR REPLACE FUNCTION public.imp_test_trigger()
    RETURNS trigger AS
  'begin
  return imp_test_to_out_test(new);
  end;'
    LANGUAGE 'plpgsql' STABLE;
  
  CREATE TRIGGER imp_test_trigger_001
    BEFORE INSERT OR UPDATE
    ON public.imp_test
    FOR EACH ROW
    EXECUTE PROCEDURE public.imp_test_trigger();
 ---
 
 regards,
 


=====
Riccardo G. Facchini

Responses

pgsql-sql by date

Next:From: Kemin ZhouDate: 2004-04-21 17:57:21
Subject: Server Side C programming Environment Set up
Previous:From: francescosafDate: 2004-04-21 15:00:23
Subject: problem with slow select

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group