創建功能我已經創建功能:在MySQL中1行
CREATE FUNCTION `push_admin`(`p_messenger` text, `p_admin_id` int(20), `p_client_id` int(20))
RETURNS INTEGER
BEGIN
INSERT INTO messenger(admin_id, client_id, messenger)
VALUES (p_admin_id, p_client_id, p_messenger);
INSERT INTO messenger(ref_id)
SELECT id FROM messenger WHERE client_id = p_client_id;
RETURN LAST_INSERT_ID();
END$$
我怎能捨棄admin_id
,client_id
,messenger
,ref_id
爲1行?
你說的給是什麼意思?你問如何在mysql中調用用戶定義的函數?與您調用任何預定義函數的方式相同。 – Shadow