![]() | Products |
| Home » Technical Support » ElevateDB Technical Support » Product Manuals » ElevateDB Version 2 SQL Manual » SQL/PSM Statements » LOOP |
[Label:] LOOP <StatementBlock> END LOOP [Label]; <StatementBlock> = <StatementBlock> = [[Label:] BEGIN] [<Statement>;] [<Statement>;] [EXCEPTION] [<Statement>;] [END [Label];]
-- This procedure loops through
-- the Customers table and exits the loop
-- when the EOF is reached on the cursor
CREATE PROCEDURE LoopCustomers()
BEGIN
DECLARE CustCursor SENSITIVE CURSOR FOR Stmt;
PREPARE Stmt FROM 'SELECT * FROM Customer';
OPEN CustCursor;
FETCH FIRST FROM CustCursor;
LOOP
IF EOF(CustCursor) THEN
LEAVE;
ELSE
FETCH NEXT FROM CustCursor;
END IF;
END LOOP;
END| Deviation | Details |
| None |
This web page was last updated on Tuesday, September 16, 2025 at 04:56 PM | Privacy Policy © 2025 Elevate Software, Inc. All Rights Reserved Questions or comments ? |

