Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2004
    Posts
    20

    Unanswered: db2V7. DECLARE EXIT HANDLER in function not working

    Hi All,

    I have

    DECLARE EXIT HANDLER FOR SQLEXCEPTION, SQLWARNING, NOT FOUND
    in a db2 function. The function does not compile and gives me an error message saying

    administrator.FUNCTION1: 11: [IBM][CLI Driver][DB2/NT] SQL0104N An unexpected token "DECLARE EXIT HANDLER FOR SQLEXCEPTION, SQ" was found following "ic declare tmp int; ". Expected tokens may include: "<space>". LINE NUMBER=11. SQLSTATE=42601


    What is going wrong. The function body is

    CREATE function test()
    returns int
    LANGUAGE SQL
    begin atomic
    declare tmp int;
    DECLARE EXIT HANDLER FOR SQLEXCEPTION, SQLWARNING, NOT FOUND
    BEGIN
    end
    return 1;
    end

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    Re: db2V7. DECLARE EXIT HANDLER in function not working

    I assume this statement is only for SPs ...

    Please read the db2 documentation to confirm ..

    Cheers
    Sathyaram
    Visit the new-look IDUG Website , register to gain access to the excellent content.

Posting Permissions

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