I need some basic help with syntax for mariaDB 10.2.15
I am using MySQL workbench to execute the sqls below but I can seem to get the syntax to work. I have tried to use the information from MariaDb websites directly but I am not having much luck.
If I could get this version of code working I can figure out the rest of my issues. Thanks
create procedure testProc ()BEGIN declare loopCounter INT; declare loopCounterMax INT declare startCounter INT; declare EndCounter INT; SET loopCounter = 100; SET loopCounterMax = 1000001; SET StartCounter = 0; SET EndCounter = 1; label1: WHILE EndCounter < loopCounterMax DO SET EndCounter = EndCounter + startCounter; SET @s = concat( 'insert into testsch.customerevents_01 select a.* from testsch.customerevents a where exists (select 1 from testsch.custeventTID_01 b where a.TID = b.TID and b.sql_row_id > ',startCounter' and b.sql_row_id < ',EndCounter ' ) '); PREPARE stmt from @s; EXECUTE stmt; DEALLOCATE PREPARE stmt; SET startCounter = EndCounter -1; END WHILE label1;END;