MySQL Forums
Forum List  »  InnoDB

using cursor
Posted by: Zombie Zombie
Date: June 18, 2010 03:45AM

Hi all,

I am trying to learn about cursor.
I googled some examples, but I was not able to run those example successfully.
I am getting the error saying:
#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 '' at line 4


The sql script is as follows:

create procedure myCursor()
begin

declare l_emp_name VARCHAR(30);
declare cur_1 cursor for select empName from employee;

open cur_1;
fetch cur_1 into l_emp_name;
close cur_1;

end;

Is there some other things missing?

Thank you for your help

regards

Options: ReplyQuote


Subject
Views
Written By
Posted
using cursor
4233
June 18, 2010 03:45AM
1547
July 20, 2010 05:35AM
1304
September 15, 2010 11:38AM


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.