MYSQL Stored Procedures: Variable Declaration and Conditional Statements
I have looked over numerous tutorials, manuals and documentations, but I still can not get this to work. I am trying to create a stored procedure using phpMyAdmin. I cant seem to find the errors here, the sql errors are so vague... CREATE PROCEDURE insertToonOneShot(IN locale CHAR(2), IN name VARCHAR(16), IN realm VARCHAR(24), IN faction CHAR(1), IN toon_level INT, IN class_name INT) BEGIN DECLARE @realmID INT; DECLARE @classID INT; DECLARE @toonID INT; SET @realmID = SELECT id FROM realms WHERE realms.name = realm; SET @classID = SELECT id FROM classes WHERE classes.name = class_name; IF NOT