Guest User

Untitled

a guest
Jan 25th, 2012
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PL/SQL 0.35 KB | None | 0 0
  1.   CREATE OR REPLACE TRIGGER "T_CONST_TIERRA"
  2. BEFORE INSERT
  3. ON ELEMENTO
  4. FOR EACH ROW
  5.  WHEN (NEW.tipo='C') DECLARE
  6.   temp VARCHAR2(30);
  7. BEGIN
  8.   SELECT pos.terreno INTO temp
  9.   FROM posicion pos
  10.   WHERE (pos.x=:NEW.x) AND (pos.y=:NEW.y);
  11.   IF temp <> 'T' THEN raise_application_error(-20100, 'Se debe construir sobre tierra');
  12.   END IF;
  13. END;
Advertisement
Add Comment
Please, Sign In to add comment