MySQL Forums
Forum List  »  Stored Procedures

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

MySQL Dev Zone
MySQL Server Documentation
Oracle

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: how to declare cursor in middle of stored procedure
1374
October 19, 2016 06:21AM


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.