Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 17 » SQL Anywhere Server - SQL Reference » SQL statements » Alphabetical list of SQL statements

CONTINUE statement

Restarts a loop.

Syntax
CONTINUE [ statement-label ]
Remarks

The CONTINUE statement is a control statement that restarts a loop. Execution continues at the first statement in the loop.

When CONTINUE appears within a set of statements using Transact-SQL, do not use statement-label.

Privileges

None.

Side effects

None.

Standards
  • ANSI/ISO SQL Standard

    Not in the standard.

  • Transact-SQL

    CONTINUE without a statement label is supported by SAP Adaptive Server Enterprise.

Example

The following fragment shows how the CONTINUE statement restarts a loop. This example displays the odd numbers between 1 and 10.

BEGIN
   DECLARE i INT;
   SET i = 0;
   lbl:
   WHILE i < 10 LOOP
      SET i = i + 1;
      IF mod( i, 2 ) = 0 THEN 
         CONTINUE lbl
      END IF;
      MESSAGE 'The value ' || i || ' is odd.' TO CLIENT;
   END LOOP lbl;
END