I want to make a continuously SQL until reach max ID.
INSERT INTO creature_classlevelstats (`level`, `class`)
VALUES
(101, 1),
(101, 2),
(101, 4),
(101, 8),
(102, 1),
(102, 2),
(102, 4),
(102, 8),
(103, 1),
(103, 2),
(103, 4),
(103, 8),
(104, 1),
(104, 2),
(104, 4),
(104, 8);
This is example of what i'll be doing, sadly that this will be long since the max can be 255. I have Tried this :
DECLARE @lvl INT
SET @lvl = 101
WHILE (@lvl <= 255)
BEGIN
INSERT INTO creature_classlevelstats (`level`, `class`) values
(101, 1),
(101, 2),
(101, 4),
(101, 8);
SELECT @lvl = @lvl + 1
END
This is the Error
[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'DECLARE @lvl INT