Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Product Manuals » ElevateDB Version 2 SQL Manual » SQL/PSM Functions » BOF |
BOF(<CursorName>) <CursorName> = Previously-opened result set cursor
BOOLEAN
-- 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' -- The whole update process is wrapped inside -- of a transaction start..commit/rollback block CREATE PROCEDURE UpdateState() BEGIN DECLARE CustCursor CURSOR WITH RETURN FOR Stmt; DECLARE State CHAR(2) DEFAULT ''; PREPARE Stmt FROM 'SELECT * FROM Customer'; OPEN CustCursor; START TRANSACTION ON TABLES 'Customer'; BEGIN FETCH LAST FROM CustCursor ('State') INTO State; WHILE NOT BOF(CustCursor) DO IF (State='FL') THEN UPDATE CustCursor SET 'State'='NY'; END IF; FETCH PRIOR FROM CustCursor ('State') INTO State; END WHILE; COMMIT; EXCEPTION ROLLBACK; END; END
Deviation | Details |
Extension | This function is an ElevateDB extension. |
This web page was last updated on Thursday, November 16, 2023 at 10:39 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |