Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exit out of WHILE @@FETCH_STATUS = 0 in db_cursor

Is there a way to exit out of the WHILE @@FETCH_STATUS = 0 while performing a db_cursor?

I tried SET @@FETCH_STATUS = 1, but as i expected, an error. Help?

like image 851
Control Freak Avatar asked Feb 15 '12 09:02

Control Freak


Video Answer


1 Answers

You can use BREAK to exit a while loop.

like image 198
Martin Smith Avatar answered Oct 28 '22 19:10

Martin Smith