|
All,
I have a SQL stored procedure defined below. When run, this procedure properly rolls back any data it was manipulation, which is good that's what I want. However, to RPG it looks as though this procedure executed successfully.
How do I indicate to RPG program that it in fact had issues and required a rollback so the RPG program can also abort properly?
CREATE PROCEDURE CQRLIB.CRTSSASTATS ( )
LANGUAGE SQL
SPECIFIC CQRLIB.CRTSSASTATS
NOT DETERMINISTIC
MODIFIES SQL DATA
CALLED ON NULL INPUT
PROGRAM TYPE SUB
CONCURRENT ACCESS RESOLUTION DEFAULT
SET OPTION ALWBLK = *ALLREAD ,
ALWCPYDTA = *OPTIMIZE ,
COMMIT = *NONE ,
DECRESULT = (31, 31, 00) ,
DFTRDBCOL = *NONE ,
DYNDFTCOL = *NO ,
DYNUSRPRF = *USER ,
SRTSEQ = *HEX
BEGIN
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION ROLLBACK;
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
INSERT INTO.... VALUES....
More INSERT INTO... VALUES
SIGNAL SQLSTATE '38T00' SET MESSAGE_TEXT = 'Error test';
END
Thanks,
Matt
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.