Deep Dive into SQL Data Insights [1129] An in-depth analysis of SQL Data Insights (SDI) from both technical and business perspectives: Technically, we explore which columns to select, the effects of normalization, data type simplification, and correlation. In summary: How can data...
1129 Deep Dive Into SQL Data Insights_1756972900866001hytD.pdf
Sounds like the stored procedures that your Atomic SQL procedure is calling are created with the COMMIT(*NONE) setting. As a result, the changes they make are not under transaction control - each change is essentially automatically committed. These subprocedures should be created with the same...
We are rewriting our billing system from legacy RPG code into SQL Stored procedure. The main proc runs within an Atomic transaction. However, it calls several other procedures that are not marked as Atomic. As a result, when an error occurs within the main proc or the others, the updates and...
Without CTE it's OK too... SELECT A.ENTRY ID, L.FUND, L.DEBIT FROM PGCLEMENT.DAVID A, LATERAL(VALUES (A.FUND1, A.DEBIT1), (A.FUND2, A.DEBIT2), (A.FUND3, A.DEBIT3), (A.FUND4, A.DEBIT4), (A.FUND5, A.DEBIT5) ) AS L(FUND, DEBIT); #SQL
Hi, Like Brigitta i use LATERAL : CREATE TABLE MY TABLE (entry id DEC(2,0), fund1 char(10), debit1 DEC(5,2), fund2 char(10), debit2 DEC(5,2), fund3 char(10), debit3 DEC(5,2), fund4 char(10), debit4 DEC(5,2), fund5 char(10), debit5 DEC(5,2) ); insert into MY TABLE VALUES(1, 'FUND A', 100, 'FUND B...
You can use also a simple union select 1, entryid, fund1, debit1 union all select 2, entryid, fund2, debit2 [...] #SQL
So, Birgitta's Solution worked with a couple of minor tweaks: Select KeyDate, KeyTime, Fund, Func, Dept, Divn, Acct, Desc, Debit, Credit from bafile ba Cross Join Lateral(Values(1, ba.Fd1, ba.Fc1, ba.Dp1, ba.Dv1, ba.Ac1, ba.Ds1, ba.Dr1, ba.Cr1), (2, ba.Fd2, ba.Fc2, ba.Dp2, ba.Dv2, ba.Ac2, ba.Ds2...