Skip to content

Error when executing an annonymus blok or procedure #2

Description

@dnlw07

While executing DB2 anonymous block I receive an error.
I assume that there is a problem with executing block as a whole. During execution @ should be taken as block terminator, not ;.
@: This symbol (or any character to define the end of the block) is used to terminate the anonymous block. In environments like command-line tools,

Error:

[IBM][CLI Driver][DB2/LINUXPPC64LE] SQL0104N An unexpected token "END-OF-STATEMENT" was found following  "MESSAGE VARCHAR(100)". Expected tokens may include: "<psm_semicolon>".  LINE NUMBER=3.  SQLSTATE=42601

Example script:

BEGIN
    DECLARE v_message VARCHAR(100);
    
    SET v_message = 'TEST';

    SELECT v_message AS MESSAGE;
END@

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions