私はストアドプロシージャのコードを以下に実行しようとしていますが、行番号14にエラーがスローされます。エラーが見つかりませんでした。MySQLストアドプロシージャの構文エラー
DELIMITER $$
CREATE PROCEDURE usp_SetGems (
-- Add the parameters for the stored procedure here
p_requestid int/* =null */,
p_akcija int/* =null */)
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
-- Insert statements for procedure here
if p_akcija = 0 then
declare @v_userId char(36);
declare @v_vingems int;
select @v_userId:=r.user_id, @v_vingems := r.value from Requests r
where r.Id=p_requestid;
update Users
set [email protected]_vingems
where id=v_userId;
else
declare @v_userrId longtext;
declare @v_vingemss int;
select @v_userrId.user_id:=r.user_id, @v_vingemss := r.value from Requests r
where r.Id=p_requestid;
update Users
set [email protected]_vingems
where id=v_userrId;
end if;
end; $$
DELIMITER ;
'Requests'テーブルの構造は何ですか? – apokryfos
@apokryfos http://prntscr.com/aqxr4o – Dunster
値は小数で、user_idはintで、変数のデータ型と一致していないようです。 – apokryfos