![]() | ![]() Products ![]() ![]() ![]() ![]() |
Home » Technical Support » ElevateDB Technical Support » Product Manuals » ElevateDB Version 2 SQL Manual » SQL/PSM Statements » IF |
IF <BooleanExpression> THEN <StatementBlock> [ELSEIF <BooleanExpression> THEN <StatementBlock>] [ELSE <StatementBlock>] END IF; <StatementBlock> = [[Label:] BEGIN] [<Statement>;] [<Statement>;] [EXCEPTION] [<Statement>;] [END [Label];]
-- This procedure uses an IF statement -- to conditionally test if the State column -- is equal to 'FL', and if so, to change it -- to 'NY' PROCEDURE UpdateState() BEGIN DECLARE CustCursor CURSOR WITH RETURN FOR Stmt; DECLARE State CHAR(2) DEFAULT ''; PREPARE Stmt FROM 'SELECT * FROM Customer'; OPEN CustCursor; FETCH FIRST FROM CustCursor ('State') INTO State; WHILE NOT EOF(CustCursor) DO IF (State='FL') THEN UPDATE CustCursor SET 'State'='NY'; END IF; FETCH NEXT FROM CustCursor ('State') INTO State; END WHILE; END
Deviation | Details |
None |
This web page was last updated on Friday, January 31, 2025 at 08:42 AM | Privacy Policy![]() © 2025 Elevate Software, Inc. All Rights Reserved Questions or comments ? ![]() |