(Contents)(Previous)(Next)

The STOP Statement

With the STOP statement it is possible to immediately terminate a program from any call nesting. A return code as well as a return text can be returned to the calling environment.

Example:

If an SQL-PL routine is called directly from the operating system (see the User Manual), then control is returned to the operating system by the STOP statement. In this case the absolute value of the return code is provided, if it is less than 126. The return code 127 is returned, if the absolute value of the return code is greater than or equal to 127. In this case it must be taken into account that SQL-PL already uses the error numbers 1 to 8 as return code (see the User Manual).

With triggers, the STOP statement leads to the failure of the trigger, i.e. the subtransaction of the trigger is rolled back. The failure of a trigger causes the SQL statement that called the trigger to fail. DB procedures and triggers cannot be called directly from the operating system.

Syntax:


(Contents)(Previous)(Next)