App-Detail #1016 JSON-Inhalte per SQL-Views nutzen

z.B. als Journal: 

create or replace view al_storage.l_storage_lagerjournal_raw_raw_LF as
select all
5 as STORAGE_ID, Posid as STORAGE_POS_ID, Posid as BUCH_NR, 'LF' as INP_KNZ, 'Abg' AS ABG_ZUG_KNZ,
'central'::character varying(50) AS LAGERORT, apos.apos_details->>'Lager'::character varying(50) AS GEGENBUCH_LAGERORT,
a.LieferDatum as BEWEGUNGS_DATUM, ARTIKELNR, ART_BEZEICHNUNG, (MENGE * -1) AS BEWEGUNGS_MENGE,
concat('ANr: ', a.ANr, ', ', 'Liefer-Adr: ', a.LieferAdressNr) as BUCHUNGSTEXT,
aPOS_details, erfasst_am::timestamp without time zone as created_at
FROM frepjs2000.AngebotePos apos join frepjs2000.Anfragen a on apos.ANr = a.ANr
where apos.apos_details->>'Lager' is not null
--
union all
--
select all
5 as STORAGE_ID, Posid as STORAGE_POS_ID, Posid as BUCH_NR, 'LF' as INP_KNZ, 'Zug' AS ABG_ZUG_KNZ,
apos.apos_details->>'Lager'::character varying(50) AS LAGERORT, 'central'::character varying(50) AS GEGENBUCH_LAGERORT,
a.LieferDatum as BEWEGUNGS_DATUM, ARTIKELNR, ART_BEZEICHNUNG, MENGE AS BEWEGUNGS_MENGE,
concat('ANr: ', a.ANr, ', ', 'Liefer-Adr: ', a.LieferAdressNr) as BUCHUNGSTEXT,
aPOS_details, erfasst_am::timestamp without time zone as created_at
FROM frepjs2000.AngebotePos apos join frepjs2000.Anfragen a on apos.ANr = a.ANr
where apos.apos_details->>'Lager' is not null
--
order by 1, 2
;
##2074 demo-online -- -
- 1 -    (TxtDoc-json-inhalte-per-sql2026-04-17.html)

download