Created
April 22, 2018 01:54
-
-
Save GreyHat147/d0d8eef51aff9cf1eedc92e43017daaa to your computer and use it in GitHub Desktop.
16, 17
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 16. */ | |
create table empleados_antiguos ( | |
documento varchar(8), | |
nombre varchar(40) | |
); | |
/* 17. */ | |
/*DROP PROCEDURE IF EXISTS empleados_antiguos;*/ | |
delimiter $ | |
create procedure empleados_antiguos(in _documento int(11)) | |
begin | |
set @fecha = (select fechaingreso from parcial.empleados where documento = _documento); | |
set @nombre = (select nombre from parcial.empleados where documento = _documento); | |
set @apellido = (select apellido from parcial.empleados where documento = _documento); | |
IF NOT @fecha between '2008-01-01' AND '2018-01-01' then | |
set @fullname = CONCAT(@nombre, ' ', @apellido); | |
insert into empleados_antiguos values (_documento, @fullname); | |
END IF; | |
end; | |
$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment