Rob,
The select does not work in the data source. It does work on Run SQL Scripts. See below:
Lateral example.png
The select does not work in the data source. It does work on Run SQL Scripts. See below:
Lateral example.png
select a.vouchr, a.vendor, x.account, x.amount from GLORIA/horfile as a cross join lateral(values (a.acT001, a.amT001), (a.acT002, a.amt002), (a.acT003, a.amT003)) as x (account, amount) where x.amount > 0
A R HORFILER
A VOUCHR 15A TEXT('VOUCHER')
A VENDOR 15A TEXT('VENDOR')
A ACT001 15A TEXT('ACCOUNT 01')
A AMT001 8S 0 TEXT('AMOUNT 01')
A ACT002 15A TEXT('ACCOUNT 02')
A AMT002 8S 0 TEXT('AMOUNT 02')
A ACT003 15A TEXT('ACCOUNT 03')
A AMT003 8S 0 TEXT('AMOUNT 03')
select vouchr, vendor, account, amount from GLORIA/horfile as s, lateral(values (acT001, amT001), (acT002, amt002), (acT003, amT003)) as t(account, amount)
SELECT s.vouchr, s.vendor, t.account, t.amount
FROM gloria/horfile AS s,
LATERAL(VALUES (act001, amt001),
(act002, amt002),
(act003, amt003)) AS t (account, amount)
SELECT s.vouchr, s.vendor, t.account, t.amount
FROM gloria/horfile s,
LATERAL(VALUES (act001, amt001),
(act002, amt002),
(act003, amt003)) t (account, amount)
select a.podate, c.dept concat '-' concat c.divn as "account", b.name, c.amount from nfcclibf.npofile a join nfcclibf.nvenmast b on b.vendno = a.povend cross join lateral (values (podp1, podv1, poam1), (podp2, podv2, poam2), (podp3, podv3, poam3)) c(dept, divn, amount) where c.amount <> 0
Comment