ストアドプロシージャ内からストアド関数を呼び出そうとすると、1064エラーが発生します。これは、私がこれを行おうとしている行でのみ発生しますSET account_id = get_account_id(user);
。問題は何ですか?どうすれば修正できますか?
アカウントID保存機能:
CREATE DEFINER=`aaron`@`%` FUNCTION `get_account_id`(user VARCHAR(255)) RETURNS int(11)
BEGIN
DECLARE xaccount_id INT DEFAULT 0;
#Get Account ID and place into variable used when calling stored procedure that builds the tree structure for the leaf node portfolio id
SELECT account_id
FROM rst_sessions.session_data
WHERE username = user
ORDER BY update_date DESC LIMIT 1
INTO xaccount_id;
RETURN xaccount_id;
END
ストアド関数を呼び出そうとしているストアドプロシージャ:
CREATE DEFINER=`aaron`@`%` PROCEDURE `build_report_portfolio_list`(user VARCHAR(255))
READS SQL DATA
BEGIN
DECLARE portf_id INT;
DECLARE portf_name VARCHAR(255);
DECLARE str_portf_parent_list VARCHAR(455);
DECLARE done INT DEFAULT 0;
DECLARE account_id INT;
SET account_id = get_account_id(user);
END