我的问题是这段代码。
DELIMITER $$
DROP PROCEDURE IF EXISTS agregar_abono$$
CREATE PROCEDURE agregar_abono(IN pid_cliente BIGINT, IN pfecha_abono DATE, IN pmonto_abono FLOAT)
BEGIN
DECLARE @idabono BIGINT;
-- OTHER CODE ...
SELECT id_abono AS idabono FROM abono WHERE fk_cliente = pid_cliente ORDER BY id_abono DESC LIMIT 1;
SELECT CONCAT('>', idabono);
CALL cobrar_abono(pid_cliente, vid_abono);
END $$
两个SELECT返回的过程:
idabono = 52 --> good! (in the first select)
CONCAT('>', idabono) = null ---> what??
我不知道,因为不要将结果存储在此变量中以在存储过程中使用。我用一个AS
来存储变量。
要调用的存储过程的标头是:
CREATE PROCEDURE cobrar_abono(IN pid_cliente BIGINT, IN pid_abono BIGINT)