Merge pull request #5 from cromerc/feature_Trigger

Se agrega Trigger 3 del enunciado.
This commit is contained in:
Chris Cromer 2020-06-09 13:58:56 -04:00 committed by GitHub
commit 815e1f1742
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

11
trigger.sql Normal file
View File

@ -0,0 +1,11 @@
CREATE OR REPLACE TRIGGER correlative_increment BEFORE INSERT ON ciudad FOR EACH ROW
DECLARE
idCiudad number;
BEGIN
SELECT MAX(id_ciudad) INTO idCiudad FROM ciudad;
:new.id_ciudad := idCiudad + 1;
END;