非常抱歉信息不完整。 这是我的两个存储过程:
DELIMITER $$
DROP PROCEDURE IF EXISTS
SP1
$$ CREATE PROCEDURESP1
(InputCustomerID int,InputOrderID int) BEGIN// 一些 SQL 语句,最后将其放入数据库中的实际表 tb1 中
END $$
DELIMITER ;
SP2 - 在 SP2 中,我正在分配 SP1 参数的输入值。
请注意,本文中的 HTML 标记已保留。DELIMITER $$
DROP PROCEDURE IF EXISTS
SP2
$$ CREATE PROCEDURESP2
() BEGINDeclare InputCustomerID int; Declare InputOrderID int; Declare OrderStateDate Datetime;
Select CustomerID into InputCustomerID From Cusomers Where CustomerID NOT IN (Select FK_CustomerID From CustomerOrders) and IsApproved = True and CustomerID IN (Select FK_CustomerID From CustomerProductOrders Where Date(OrderStartDate) = Date(Now()));
Select OrderID into InputOrderID From CustomerOrders Where FK_CustomerID NOT IN (Select FK_CustomerID From CustomerProdcutOrders) and IsApproved = True and Date(OrderStartDate) = Date(Now());
Call SP1(InputCustomerID, InputOrderID);
END $$
DELIMITER ;