Can you see anything wrong with this code? I tried modifying all the code around MySQL keeps pointing to this line, so it's gotta be in here:
DECLARE updateLinks CURSOR FOR SELECT categoryToCategoryID, level, sortHistory, sortTitleHistory FROM b2casp.categoryToCategory WHERE sortHistory REGEXP oldSortHistory AND sortTitleHistory REGEXP oldsortTitleHistory;
Any ideas please?