MySQL Forums
Forum List  »  InnoDB

Cursor Problem
Posted by: Rama Krishna G
Date: November 13, 2008 12:54AM

Hi,

I am facing probelm with cursor and getting below exception

Error Code : 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'startpos,endpos ;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;
-- Collecting ' at line 10
(0 ms taken)


see my proc code;

CREATE DEFINER=`root`@`%` PROCEDURE `test`(IN PortFolioID bigint(20),OUT statsId bigint(20),IN startpos bigint(15),IN endpos bigint(20))
BEGIN

DECLARE cur1 CURSOR FOR select distinct(oan) from temp_account where status='NEW' limit startpos ,endpos ;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;
-- Collecting Statistics information
...
...
...
END

Thanks in Advance

Options: ReplyQuote


Subject
Views
Written By
Posted
Cursor Problem
5333
November 13, 2008 12:54AM
2749
December 17, 2008 11:24AM
2657
December 25, 2008 09:33PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.