Advertisement
Guest User

Untitled

a guest
Nov 24th, 2014
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. create table datos_prueba(
  2. nombre varchar2(10) primary key,
  3. numero number(3),
  4. mensaje varchar(30),
  5. fecha date);
  6.  
  7. create table store_datos_prueba(
  8. nombre varchar(20) primary key,
  9. numero number(5),
  10. mensaje varchar(30),
  11. fecha date);
  12.  
  13. create or replace trigger tgr_trigger_prueba
  14. after insert on datos_prueba
  15. for each row
  16. declare
  17. cambio_numero number;
  18. begin
  19. if :datos_prueba.numero <= 5 then
  20. insert into store_datos_prueba (nombre,numero,mensaje,fecha) values(:datos_prueba.nombre,666,:datos_prueba.mensaje,:datos_prueba.fecha);
  21. else
  22. insert into store_datos_prueba (nombre,numero,mensaje,fecha) values(:datos_prueba.nombre,777,:datos_prueba.mensaje,:datos_prueba.fecha);
  23. end if;
  24. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement