0
我有一個存儲過程如下。使用mysql存儲過程創建並插入臨時表
在這裏,我創建了一個名爲tempDesTable的臨時表,並從數據庫中放入數據。現在我必須從另一個選擇查詢中輸入其他數據。但它表明Error Code : 1327 Undeclared variable: tempDesTable
BEGIN
CREATE TEMPORARY TABLE tempDesTable AS (SELECT ID, FirstName, LastName FROM t_users WHERE `DesignationID` = p_DesignationID AND BranchID = 0);
SELECT ID, FirstName, LastName INTO `tempDesTable` FROM t_users WHERE `DesignationID` = p_DesignationID AND BranchID = p_BranchID;
END$$