MySQL Forums :: Stored Procedures :: how to declare cursor in middle of stored procedure


Advanced Search

Re: how to declare cursor in middle of stored procedure
Posted by: Jon Stephens ()
Date: October 19, 2016 06:21AM

You've got several issues, amongst them being:

·MySQL has no COMPUTE_WEEKS() function

·MySQL has no PROJECTED keyword

·You create the table as FCST but refer to it in later statements as fcst

·INSERT INTO FCST1 VALUES (loop_cntr1,i3,Y,0,0,'Y'); inserts the string value 'Y' into the last column, and not the value you selected into the variable Y in the previous line.

Two suggestions:

1. If you're accustomed to using a different RDBMS, don't take it for granted that we support exactly what they do. Consult our documentation for what we actually support, and how.

2. This procedure is not exactly small or trivial. I suggest you break it down into smaller functions/procedures which should be easier to debug. Once you get all the bits working, you can combine them.


cheers

jon.

Jon Stephens
MySQL Documentation Team @ Oracle
Stockholm, Sweden

MySQL Dev Zone
MySQL Server Documentation
Oracle

Options: ReplyQuote


Subject Views Written By Posted
how to declare cursor in middle of stored procedure 1862 BHANU PRATAP MUNAGALA 10/19/2016 03:36AM
Re: how to declare cursor in middle of stored procedure 218 Jon Stephens 10/19/2016 06:21AM
Re: how to declare cursor in middle of stored procedure 267 BHANU PRATAP MUNAGALA 10/19/2016 08:22AM
Re: how to declare cursor in middle of stored procedure 325 Peter Brawley 10/19/2016 09:26AM
Re: how to declare cursor in middle of stored procedure 229 BHANU PRATAP MUNAGALA 10/19/2016 10:04AM
Re: how to declare cursor in middle of stored procedure 314 Peter Brawley 10/19/2016 11:10AM
Re: how to declare cursor in middle of stored procedure 244 Rick James 10/19/2016 11:47PM


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.