Unsupported Screen Size: The viewport size is too small for the theme to render properly.

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • in reply to: Declare Cursor Statement In Stored-Procedure #32347

    Yes, ahswin

    I read the documentation in more deep way.

    But the DECLARE CURSOR documentation does not make any reference to the DECLARE statement.

    Infact, the DECLARE CURSOR documentation only say that:

    12.7.5.1. DECLARE for Cursors

    Syntax: DECLARE cursor_name CURSOR FOR select_statement

    Description: This statement declares a cursor. Multiple cursors may be declared in a stored program, but each cursor in a given block must have a unique name.

    The SELECT statement cannot have an INTO clause.

    Local variables should not be declared with the same name as columns referenced by the SELECT statement, for reasons described in Section 12.7.3.4, “Scope and Resolution of Local Variables”.

    For information available through SHOW statements, it is possible in many cases to obtain equivalent information by using a cursor with an INFORMATION_SCHEMA table.

    While the DECLARE statement well explain as follow

    12.7.2. DECLARE Syntax

    The DECLARE statement is used to define various items local to a program:

    Local variables. See Section 12.7.3, “Variables in Stored Programs”.

    Conditions and handlers. See Section 12.7.4, “Conditions and Handlers”.

    Cursors. See Section 12.7.5, “Cursors”.

    DECLARE is permitted only inside a BEGIN … END compound statement and must be at its start, before any other statements.

    Declarations must follow a certain order. Cursors must be declared before declaring handlers, and variables and conditions must be declared before declaring either cursors or handlers.

    The bold part is the key of my mistake.

    I think that the 12.7.5.1 section should have at least a remaind to the 12.7.2 section (but is not a problem fixable by WEByog, of course!)

    Thank you for the support.

    Regards

    in reply to: Declare Cursor Statement In Stored-Procedure #32345

    OK Peter,

    this evening I'll try to create a stored procedure that start with a cursor declaration only, then I'll add some other code. I hope this strategy allow me to trap the issue(s) or what is wrong in my stored procedure code.

    I'll post the results as possible.

    Thank you for the support.

    Regards

Viewing 2 posts - 1 through 2 (of 2 total)