HPlogo ALLBASE/SQL Reference Manual: HP 9000 Computer Systems > Chapter 11 SQL Statements E - R

GOTO

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

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;
Feedback to webmaster