HPlogo ALLBASE/SQL Reference Manual > Chapter 11 SQL Statements E - R

GOTO

MPE documents

Complete PDF
Table of Contents
Index

E0300 Edition 9 ♥
E0399 Edition 8
E0897 Edition 7

The GOTO statement permits a jump to a labeled statement within a procedure.

Scope


Procedures only

SQL Syntax



  {GOTO
   GO TO}{Label
          Integer}

Parameters


Label

specifies an identifier label for branching within the procedure.

Integer

specifies an integer label for branching within the procedure.

Description


The label or integer referred to in a GOTO statement is followed by a colon and a statement.

Authorization


Anyone can use the GOTO statement.

Example



   CREATE PROCEDURE Process10 AS
      BEGIN
         INSERT INTO SmallOrders VALUES ('Widget', 10);
         IF ::sqlcode <> 0 THEN
            GOTO Errors;
         ENDIF;
         RETURN 0;

         Errors: PRINT 'There were errors.';
         RETURN 1;
      END;




GENPLAN


GRANT