Hi!
I am sorry for the incomplete information. Here's my two sp's: SP1 - DELIMITER $$
DROP PROCEDURE IF EXISTS SP1
$$
CREATE PROCEDURE SP1
(InputCustomerID int, InputOrderID int)
BEGIN
// Some sql statements and finally put it into the actual table tb1 in the database
END $$
DELIMITER ;
SP2 - In SP2 i am assigning input value of SP1's params.
DELIMITER $$
DROP PROCEDURE IF EXISTS SP2
$$
CREATE PROCEDURE SP2
()
BEGIN
Declare 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 ;