Skip navigation links

MySQL Forums :: Cursors :: Using Cursors


Advanced Search

Re: Using Cursors
Posted by: Liz Abraham ()
Date: August 08, 2005 05:42PM

CREATE PROCEDURE proc1()
BEGIN
declare sid varchar(15);
declare sname varchar(30);
declare test booloean default FALSE;
DECLARE sn CURSOR FOR SELECT SiteId,SiteName from tableA;

declare continue handler for not found
set test:=TRUE;

open sn;
repeat
fetch sn into sid,sname
if not test then
update tableB set sitename=sname where siteid=sid;
end if;
until test
end repeat;
CLOSE sn;
END;


The error message is :
ERROR 1064: You have an error in your SQL syntax:check the manual that corresponds to your MYSQL server for the right syntax near 'PROCEDURE proc1()
BEGIN
declare sid varchar(15);

Thanks!!

Options: ReplyQuote


Subject Views Written By Posted
Using Cursors 8082 Liz Abraham 08/08/2005 11:33AM
Re: Using Cursors 2973 Roland Bouman 08/08/2005 01:30PM
Re: Using Cursors and ERROR 1329 no data to FETCH 6126 Rekha Singh 10/11/2006 12:55PM
Re: Using Cursors 2782 Liz Abraham 08/08/2005 05:06PM
Re: Using Cursors 2539 Roland Bouman 08/08/2005 05:18PM
Re: Using Cursors 2327 Liz Abraham 08/08/2005 05:22PM
Re: Using Cursors 2435 Liz Abraham 08/08/2005 05:27PM
Re: Using Cursors 2358 Roland Bouman 08/08/2005 05:31PM
Re: Using Cursors 2231 Liz Abraham 08/08/2005 05:42PM
Re: Using Cursors 2397 Roland Bouman 08/08/2005 06:24PM
Re: Using Cursors 2253 KimSeong Loh 08/09/2005 11:48PM
Re: Using Cursors 2278 Roland Bouman 08/10/2005 02:20AM
Re: Using Cursors 2263 Liz Abraham 08/16/2005 10:45AM
Re: Using Cursors 2447 Roland Bouman 08/16/2005 12:46PM


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.