Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Product Manuals » ElevateDB Version 2 SQL Manual » SQL/PSM Statements » LOG EVENT |
LOG [INFORMATION|WARNING|ERROR] EVENT <Message>
-- This procedure uses a LOG ERROR EVENT -- statement to log an event when an error occurs CREATE PROCEDURE UpdateState() BEGIN DECLARE CustCursor CURSOR WITH RETURN FOR Stmt; DECLARE CustNo INTEGER DEFAULT 0; DECLARE State CHAR(2) DEFAULT ''; PREPARE Stmt FROM 'SELECT * FROM Customer'; OPEN CustCursor; START TRANSACTION ON TABLES 'Customer'; BEGIN FETCH FIRST FROM CustCursor ('State') INTO State; WHILE NOT EOF(CustCursor) DO IF (State='FL') THEN UPDATE CustCursor SET 'State'='NY'; FETCH FROM CustCursor ('CustNo') INTO CustNo; END IF; FETCH NEXT FROM CustCursor ('State') INTO State; END WHILE; COMMIT; EXCEPTION LOG ERROR EVENT 'Unexpected error occurred during the UpdateState procedure: '+ CAST(ERRORCODE() AS VARCHAR)+' '+ERRORMSG(); 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 |