Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2014

    Unanswered: How can we handle Stored Procedure Errors in outer calling SQL-Script?


    We have a SQL-Script in CLPPLUS that is calling a Stored Procedure in SQL PL. The SQL-Script has to stop if the Procedure fails.

    How can we handle the result from the Procedure? We tried Signals, Return Codes, OUT-Parameter. But how can we handle this in the outer SQL? Is there no IF or CASE that we can use?

    We need something like this:

    CALL procedure_xy(...);

    IF error THEN

    our error handling

    END IF

    SELECT ...


    Anybody got an idea?

    thanks and regards

  2. #2
    Join Date
    Apr 2008
    Iasi, Romania
    Provided Answers: 3
    I think it should work:
    IF SQLCODE = 0 THEN success
    Florin Aparaschivei
    DB2 9.7, 10.5 on Windows
    Iasi, Romania

Posting Permissions

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