MySQL Forums
Forum List  »  Stored Procedures

Declare Cursor -- simple failure
Posted by: Michael Ayres
Date: March 14, 2016 01:10PM

Very rookie question I have tried and failed to understand myself. This fails:

DECLARE my_cur CURSOR FOR select ID FROM crccrmf.users;

With this error:

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 'DECLARE my_cur CURSOR FOR select ID FROM crccrmf.users' at line 1 0.000 sec

How simple. Do I have some missing setting? I can fully execute any stand alone Select statement from my query window to the open database with no problems, do updates, insert into etc.

Michael Ayres
Senior Technical Project Manager
Cyber Security Coordination Center

Michael Ayres, MS, PMP, ACP, CISSP
University of California Office of the President (contractor)
1111 Franklin Street #7109 Oakland, Ca.94607 | (510) 987-9459 | (415) 999-2049 Mobile

Options: ReplyQuote

Written By
Declare Cursor -- simple failure
March 14, 2016 01:10PM

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.