Re: Problema con Funcion y Trigger

From: "Julio Cesar Culebro Gonzalez" <jculebro(at)cgsystemsis(dot)com>
To: <pgsql-es-ayuda(at)postgresql(dot)org>
Subject: Re: Problema con Funcion y Trigger
Date: 2005-07-27 21:21:09
Message-ID: 000c01c592f1$1cbbcad0$0300a8c0@cositia
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

Veo que ya te ayudaron, el ejemplo que te pasaron es el correcto, solo me
gustaria mensionarte que las funciones de tipo trigger no deben tener
parametros explisitos, pero de forma implisita se te envian varias variables
o mejor dicho estan disponibles varias variables en el contexto de tu
funcion sin necesidad de declarar nada:

NEW : Data type RECORD; variable holding the new database row for
INSERT/UPDATE operations in ROW level triggers.

OLD : Data type RECORD; variable holding the old database row for
UPDATE/DELETE operations in ROW level triggers.

TG_NAME : Data type name; variable that contains the name of the trigger
actually fired.

TG_WHEN : Data type text; a string of either BEFORE or AFTER depending on
the trigger's definition.

TG_LEVEL : Data type text; a string of either ROW or STATEMENT depending on
the trigger's definition.

TG_OP : Data type text; a string of INSERT, UPDATE or DELETE telling for
which operation the trigger is fired.

TG_RELID : Data type oid; the object ID of the table that caused the
trigger invocation.

TG_RELNAME : Data type name; the name of the table that caused the trigger
invocation.

TG_NARGS : Data type integer; the number of arguments given to the trigger
procedure in the CREATE TRIGGER statement.

Saludos

In response to

Responses

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Julio Cesar Culebro Gonzalez 2005-07-27 21:26:12 Re: Problema con Funcion y Trigger
Previous Message Martín Marqués 2005-07-27 21:13:43 Re: Problema con Funcion y Trigger