WHENEVER Usage Notes - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
Language
English (United States)
Last Update
2024-04-03
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905
  • If the precompiler SQLFLAGGER option is set to ENTRY, WHENEVER SQLWARNING causes a precompiler warning.
  • The rules for the object of a GO TO are language-dependent. See Teradata® Preprocessor2 for Embedded SQL Programmer Guide, B035-2446.
  • The initial implied exception declaration is CONTINUE.
  • An exception declaration applies to an SQL statement only if that statement follows the exception declaration in the text of the program and there are no intervening exception declarations for the same exception condition.

    The following table shows where the application continues execution if an exception condition applies, depending on the specified action.

    Action Where Execution Continues
    CONTINUE Next sequential instruction.

    The exception condition is ignored.

    GOTO Specified target location.

    host_label must be such that a client language GO TO statement specifying that target is valid at every SQL statement to which the exception declaration applies.

    CALL Next sequential instruction only after the specified subprogram has been run (called) and control has been returned to the calling program.

    A corresponding client statement (CALL function call for COBOL and PL/I or function call for C) must be valid at every SQL statement to which the exception declaration applies.

    PERFORM Next sequential instruction only after the specified COBOL paragraphs or sections have been run.

    A corresponding COBOL statement (PERFORM code) must be valid at every SQL statement to which the exception declaration applies.

  • The following table shows the SQLCODE values that can follow the execution of an SQL statement and their corresponding exception conditions:
    SQLCODE Exception Condition
    Negative number SQLERROR
    Positive number other than +100 SQLWARNING
    +100 NOT FOUND