Sql Trigger Trouble

Posted by SImon on Stack Overflow See other posts from Stack Overflow or by SImon
Published on 2010-06-02T12:19:35Z Indexed on 2010/06/02 12:23 UTC
Read the original article Hit count: 204

Filed under:
|
|

Hey guys i cant get this trigger to work, ive worked on it for an hour or so and cant see to figure out where im going wrong, any help would be appreciated

CREATE OR REPLACE TRIGGER allergy

BEFORE INSERT ON

DECLARE med VARCHAR2(20);

BEGIN

SELECT v.medication RCD.specify INTO med FROM visit v, relcondetails RCD WHERE :new.medication = v.medication AND RCD.specifiy = 'allergies';

IF med = allergies THEN RAISE_APPLICATION_ERROR(-20000, 'Patient Is alergic to this medication'); END IF; END allergy;

When put into oracle ERROR at line 6: ORA-04079: invalid trigger specification

© Stack Overflow or respective owner

Related posts about php

Related posts about sql