Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Product Manuals » ElevateDB Version 2 SQL Manual » SQL/PSM Statements » SET PROGRESS |
SET PROGRESS TO <CompletionPercent>
-- This procedure uses a SET PROGRESS -- statement to display progress during its -- execution and uses the ABORTED function -- to abort the execution if the application -- requests it CREATE PROCEDURE UpdateState() BEGIN DECLARE CustCursor CURSOR WITH RETURN FOR Stmt; DECLARE State CHAR(2) DEFAULT ''; DECLARE TotalRows INTEGER DEFAULT 0; DECLARE NumRows INTEGER DEFAULT 0; PREPARE Stmt FROM 'SELECT * FROM Customer'; OPEN CustCursor; SET TotalRows=ROWCOUNT(CustCursor); START TRANSACTION ON TABLES 'Customer'; BEGIN FETCH FIRST FROM CustCursor ('State') INTO State; WHILE (NOT (EOF(CustCursor) OR ABORTED)) DO IF (State='FL') THEN UPDATE CustCursor SET 'State'='NY'; END IF; FETCH NEXT FROM CustCursor ('State') INTO State; SET NumRows=NumRows+1; SET PROGRESS TO TRUNC(((NumRows/TotalRows)*100)); END WHILE; IF (NOT ABORTED) THEN COMMIT; ELSE ROLLBACK; END IF; EXCEPTION ROLLBACK; END; END
Deviation | Details |
Extension | This SQL statement 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 |