[英]Call Stored Procedures within a Stored Procedure with IF Logic
Unable to to call a stored procedure based on IF
logic within a stored procedure. 无法在存储过程中基于
IF
逻辑调用存储过程。 I need to return the results of 1 of 2 stored procedures depending on the date of the month. 我需要根据月份的日期返回2个存储过程中的1个的结果。
The logic is improperly formatted and I do not know the correct way to format this for the desired results. 逻辑格式不正确,我不知道为所需结果格式化的正确方法。
Both procedures being called are just SELECT
queries. 这两个过程都只是
SELECT
查询。
............................................ ............................................
DELIMITER //
CREATE PROCEDURE report_novea_remittance()
BEGIN
SELECT IF( DAYOFMONTH(CURDATE()) < 15,
CALL report_novea_1st_15th(),
CALL report_novea_16st_EOM());
END
DELIMITER ;
................................................ ................................................
IF day of month is greater than the 15th call report_novea_1st_15th()
如果一个月中的某天大于第15个通话,则report_novea_1st_15th()
IF false call CALL report_novea_16st_EOM()
如果错误呼叫CALL report_novea_16st_EOM()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.