Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

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

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.