I have a stored procedure and function as below
CREATE PROCEDURE ProcName()
begin
....
DECLARE curs CURSOR FOR select A.PList, B.nid from persons A inner join articles B on
A.aid=B.id;
....
REPEAT
FETCH curs INTO var1, var2;
....
SELECT SPLITER(var1,"|",a) into @Name;
....
UNTIL bDone END REPEAT;
CLOSE curs;
END
CREATE FUNCTION SPLITER(x VARCHAR(255), delim VARCHAR(12), pos INT) RETURNS varchar(255) CHARSET latin1 RETURN REPLACE(SUBSTRING(SUBSTRING_INDEX(x, delim, pos), LENGTH(SUBSTRING_INDEX(x, delim, pos -1)) + 1),delim, '')
now the select statement of the cursor returns about 400,000 records, and thus once i
call ProcName it returns ERROR 1305 (42000): FUNCTION myDb.SPLITER does not exist
if i changed the query of cursor to handle 50,000 only (as limit) the procedure works fine!!
any idea of how to overcome this issue?
Thanks for your help