Subject | Re: [firebird-support] Check in Trigger. |
---|---|
Author | Martijn Tonies |
Post date | 2004-09-10T13:36:57Z |
Hi,
nfecha_sistema = CURRENT_TIMESTAMP;
Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com
> I need to realize a trigger to grant that before delete a row, check ifYou know, CURRENT_TIMESTAMP is a function, you can do:
> it can be deleted, but I don't know how do it.
>
> CREATE TRIGGER comprueba_fechas FOR ofertas
> BEFORE DELETE
> AS
> DECLARE VARIABLE :nfecha_sistema;
> BEGIN
> SELECT CURRENT_TIMESTAMP
> FROM RDB$Database INTO :nfecha_sistema;
nfecha_sistema = CURRENT_TIMESTAMP;
> IF (OLD.FECHA_VALIDEZ<= :nfecha_sistema) THENRaise an exception.
> /* DOES NOT DELETE THE ROW */
> ELSEDo nothing.
> /* DOES DELETE THE ROW */
> ENDWith regards,
Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com