Forums » General Discussion

Thread: debug error occured when specify "cursor" statement in procedure

This question is not answered. Helpful answers available: 2. Answered answers available: 1.


Permlink Replies: 3 - Pages: 1 - Last Post: Dec 20, 2011 2:20 PM by: Seeker
hoocan

Posts: 2
Registered: 12/2/10
debug error occured when specify "cursor" statement in procedure
Posted: Dec 2, 2010 7:16 PM
 
  Click to reply to this thread Reply

SQL Code:
DROP PROCEDURE IF EXISTS `5000aaa`.proc_test;
CREATE PROCEDURE `5000aaa`.`proc_test`()
BEGIN
 DECLARE done INT DEFAULT 0;
 
 DECLARE cur_test CURSOR FOR SELECT user_cde FROM web_org_user LIMIT 0,1;
 DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done=1;  
END;


Error Info:
 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 'DECLARE CALL questsoftware.DEBUGSET('done','L',done)' at line 1

 CREATE PROCEDURE questdebug.1b52f6afbb5ef9e22cd76ca8a01efee86a8c7eaeimpl()
BEGIN
 DECLARE done INT DEFAULT 0;
 
 DECLARE CALL questsoftware.DEBUGSET('done','L',done);CALL questsoftware.DEBUGTRACE('PROCEDURE','5000aaa','proc_test',5);cur_test CURSOR FOR SELECT user_cde FROM `5000aaa`.web_org_user LIMIT 0,1;
 DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done=1;
  
CALL questsoftware.DEBUGSET('done','L',done);CALL questsoftware.DEBUGTRACE('PROCEDURE','5000aaa','proc_test',8);END;

Suggest:

 Toad for MySql 5.0.0.345, Statement "DECLARE cur_test CURSOR FOR xxx"  is replaced by "DECLARE CALL questsoftware.DEBUGSET('done','L',done);CALL questsoftware.DEBUGTRACE('PROCEDURE','5000aaa','proc_test',5);cur_test CURSOR ", are there any Settings must be setted for Toad ?

Sorry for All:
 i'm not good at English




Beginner

Posts: 2
Registered: 12/21/10
Re: debug error occured when specify "cursor" statement in procedure
Posted: Dec 21, 2010 6:30 AM   in response to: hoocan
 
  Click to reply to this thread Reply

Dummy question:
How do I open the command line?


Dileep

Posts: 1
Registered: 6/15/11
Re: debug error occured when specify "cursor" statement in procedure
Posted: Jun 15, 2011 1:11 AM   in response to: hoocan
 
  Click to reply to this thread Reply

Is there any update on the above issue?I am also facing similar problem.


Seeker

Posts: 2
Registered: 12/20/11
Re: debug error occured when specify "cursor" statement in procedure
Posted: Dec 20, 2011 2:20 PM   in response to: hoocan
 
  Click to reply to this thread Reply

I am having the same error.  Toad is inserting its statements inside the CURSOR declaration statement causing SQL error in the same manner described by hoocan. I am using Toad 6.0.1.1723, MySQL 5.1.46





Legend
Guru: 2001 + pts
Expert: 751 - 2000 pts
Enthusiast: 31 - 750 pts
Novice: 0 - 30 pts
Moderators
Helpful answer (5 pts)
Answered (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums