From: | Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl> |
---|---|
To: | leonardo(dot)amezquita(at)ubiquando(dot)com(dot)co |
Cc: | pgsql-es-ayuda(at)postgresql(dot)org |
Subject: | Re: ayuda con triggers |
Date: | 2005-02-08 00:02:14 |
Message-ID: | 20050208000214.GB9806@dcc.uchile.cl |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-es-ayuda |
On Mon, Feb 07, 2005 at 05:22:33PM -0600, leonardo(dot)amezquita(at)ubiquando(dot)com(dot)co wrote:
Hola,
> IF NOT FOUND THEN
> [...]
> END IF;
> IF FOUND THEN
Que tal si haces ELSE aqui mejor? El INSERT del "IF NOT FOUND" setea
FOUND, y luego entra en el otro IF. No estoy seguro si este es tu
problema. La documentacion dice
The second method to determine the effects of a command is to check the
special variable named FOUND, which is of type boolean. FOUND starts out
false within each PL/pgSQL function call. It is set by each of the
following types of statements:
* A SELECT INTO statement sets FOUND true if it returns a row, false
if no row is returned.
* A PERFORM statement sets FOUND true if it produces (and discards)
a row, false if no row is produced.
* UPDATE, INSERT, and DELETE statements set FOUND true if at least
one row is affected, false if no row is affected.
--
Alvaro Herrera (<alvherre[(at)]dcc(dot)uchile(dot)cl>)
We take risks not to escape from life, but to prevent life escaping from us.
From | Date | Subject | |
---|---|---|---|
Next Message | Roberto Pupo | 2005-02-08 00:03:09 | Windows 2003 server |
Previous Message | Fernando Aguada | 2005-02-07 23:35:48 | Re: Sincronizar bases de datos |