1
I have 2 procedures and I wanted to call the trial sp_is_temporada
in the past sp_calcula_curso
, where the value of the sp_is_temporada
return will be used in procecure sp_calcula_curso
, and the arguments that were passed in the past sp_calcula_curso
will be used in the process sp_is_temporada
.
DROP PROCEDURE IF EXISTS SP_IS_TEMPORADA;
DELIMITER //
CREATE PROCEDURE SP_IS_TEMPORADA(IN SPA_CURSO_ID INT, IN SPA_DATA DATE, IN SPA_CURSO_NAVIGATION_ID INT, INOUT SPA_TEMPORADA INT)
BEGIN
SELECT '1' INTO SPA_TEMPORADA FROM curso_temporada WHERE curso_id = SPA_CURSO_ID and SPA_DATA BETWEEN dt_inicio and dt_fim and IFNULL(curso_navigation_id,1) = IFNULL(SPA_CURSO_NAVIGATION_ID,1);
END //
DELIMITER ;
DROP PROCEDURE IF EXISTS SP_CALCULA_VALOR_CURSO;
DELIMITER //
CREATE PROCEDURE SP_CALCULA_VALOR_CURSO (IN SPA_CURSO_ID INT, IN SPA_CURS0_MOEDA_ID INT, IN SPA_IDADE INT, IN SPA_DATA DATE, INOUT SPA_VALOR_CURSO DOUBLE(20,2))
BEGIN
SELECT `valor` INTO SPA_VALOR_CURSO FROM curso_preco2 WHERE curso_id = SPA_CURSO_ID AND moeda_id = SPA_CURS0_MOEDA_ID AND SPA_IDADE BETWEEN idade_de AND idade_ate;
END//
DELIMITER ;
And you want to know what to call ?
– Diego Souza
I read something about EXEC, but I could not understand very well, how I would pass the arguments of sp_calcula_curso in the exec of sp_is_temporada, and how I would return that too..
– Michel Henriq