TurboSQL Guide

IF Statement

Previous  Top  Next

Syntax

IF search_condition THEN if_statement [ELSE else_statement]

Description

Executes the if_statement if and only if search_condition evaluates to True. If search_condition does not return True and else_statement is given, it is executed.

Sample

IF :s <> '' THEN SET :s = :s + ', '

IF :a > 0 THEN BEGIN
       SET :r = SQRT(:a)
END ELSE BEGIN
       SET :r = SQRT(-:a)
END

Compatibility Information

This statement is only available in TurboDB Managed.