× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



running an SQL procedure that creates a new table from the resulting rows
of a select statement. The code runs, but then when I signoff the system
is deleting the table. I guess because of commitment control.

how do I commit changes made in an SQL procedure?

I am using "set option commit = *chg" . Which I read says the sql
procedure should auto commit its changes. But the auto commit is not
happening.

Running the COMMIT command, the system comes back and says COMMIT defn not
found. But I WRKJOB option 16 commitmet control status, and there are two
committment definitions.

Commitment
Definition Text
APLUS Activation-group-level
QDBAGILE Activation-group-level


here is the SQL procedure:
CREATE or replace PROCEDURE SRICHTER/cca_hsdetCca(
)
LANGUAGE SQL
MODIFIES SQL DATA
set option commit = *chg
BEGIN atomic

declare vSqlCode decimal(5,0) ;
declare sqlCode int DEFAULT 0 ;
DECLARE VMSG CHAR(256) ;
DECLARE VCMDSTR CHAR(256) ;
DECLARE DUMMY INTEGER ;
declare vPrCatNum int ;

create table srsql/hsdetcca as (
select a.*, b.cmcscl cscl, b.cmcssc cssc
from hsdetv1 a
join cusms b on a.csno = b.cmcsno and b.cmcono = 1
where b.cmcscl = '05' and year(a.ivdate) >= 2016
and a.litp = 'I' or ( a.litp = 'C' and a.itno = '&6' )
) with data ;

END

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.