Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2012
    Posts
    1

    Unhappy Unanswered: DB2 Database stored procedure error

    nearly I got a problem about stored procedure of DB2.
    the program is below:
    CREATE PROCEDURE SHOW(out fname varchar)
    RESULT SETS 1
    LANGUAGE SQL
    BEGIN
    DECLARE C1 CURSOR WITH RETURN FOR
    SELECT FILE_NAME FROM A_FILE_INFO
    WHERE FILE_OWN=509;
    OPEN C1;
    END @

    EXEC SHOW;
    when exeuted ,the error is :
    DB2 SQL error: SQLCODE: -104, SQLSTATE: 42601, SQLERRMC: END-OF-STATEMENT;WHERE FILE_OWN=509;<psm_semicolon>
    Message: An unexpected token "END-OF-STATEMENT" was found following "WHERE FILE_OWN=509". Expected tokens may include: "<psm_semicolon>".
    Line: 7 
    I 'm puzzled with it,I don't know the error message exactually mean ,could anyone help me?

  2. #2
    Join Date
    Aug 2008
    Posts
    147
    How are you trying to create the stored procedure?
    What did you set the statement termination character ?
    ---------------------------------
    www.sqlserver-dba.com
    www.dba-db2.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •