Home » SQL & PL/SQL » SQL & PL/SQL » Triger help
Triger help [message #37000] Wed, 09 January 2002 17:14 Go to next message
Jan MAREK
Messages: 2
Registered: January 2002
Junior Member
Why does this not work ?
CREATE OR REPLACE trigger zakaznici_vymaz
BEFORE DELETE ON honza.zakaznici
FOR EACH ROW
BEGIN WHEN((SELECT stav FROM honza.objednavka)=0)
DELETE FROM honza.objednavka
WHERE (id_zak = :old.id_zak);
END zakaznici_vymaz;
I use Oracle 8.1.7
I need delete from table honza.objednavka only if the column "stav" (is in the table honza.objednavka) has the 0 value.
Thanx
Re: Triger help [message #37001 is a reply to message #37000] Wed, 09 January 2002 18:01 Go to previous message
Suresh Vemulapalli
Messages: 624
Registered: August 2000
Senior Member
CREATE OR REPLACE trigger zakaznici_vymaz
BEFORE DELETE ON honza.objednavka
FOR EACH ROW
BEGIN
IF :old.stav <>0 then
raise_application_error (-20100,'Stav is non zero');
END IF;
END zakaznici_vymaz;
Previous Topic: Re: Interaction between VB and Oracle Procedure using Cursor as return type
Next Topic: Help on Triggers
Goto Forum:
  


Current Time: Tue Mar 31 06:09:26 CDT 2020