Funcion y Trigger

From: "Mario A(dot) Soto Cordones" <mario_soto(at)venezolanadeavaluos(dot)com>
To: <pgsql-es-ayuda(at)postgresql(dot)org>
Subject: Funcion y Trigger
Date: 2005-04-07 12:17:31
Message-ID: 40753.200.35.66.77.1112876251.squirrel@mail.venezolanadeavaluos.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

Hola lista, tengo la siguiente funcion gatillada por un trigger que
verifica una condicion para que no se puedan borrar algunos registros:

CREATE OR REPLACE FUNCTION "public"."trig_check_delete_sadpte" () RETURNS
trigger AS'
BEGIN
IF old.id_estado = ''SY'' THEN
RAISE EXCEPTION ''NO PUEDE ELIMINAR ESTE DATO YA QUE ES RESERVADO
PARA EL SISTEMA!'';
END IF;
END;
'LANGUAGE 'plpgsql' VOLATILE RETURNS NULL ON NULL INPUT SECURITY INVOKER;

CREATE TRIGGER "trig_delete_sadpte" BEFORE DELETE
ON "public"."sadpte" FOR EACH ROW
EXECUTE PROCEDURE "public"."trig_check_delete_sadpte"();

Pero al ejecutar por ejemplo

delete from sadpte, sale el siguiente error:

ERROR: control reached end of trigger procedure without RETURN

No entiendo que pueda ser

Saludos

Responses

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Alvaro Herrera 2005-04-07 12:36:38 Re: Funcion y Trigger
Previous Message Santiago David Delgado Llopis 2005-04-07 07:51:05 Postgres + Aubit4gl