From e0c243d993c640d7f7aa35e940de55af8055445a Mon Sep 17 00:00:00 2001 From: Marlies Winterstein Date: Thu, 16 Mar 2023 14:54:28 +0100 Subject: [PATCH] =?UTF-8?q?=C3=84nderungen=20bei=20xcube=5Fhoererstatus?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xcube/schluesseltabellen/create_views.sql | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src-modules/module/xcube/schluesseltabellen/create_views.sql b/src-modules/module/xcube/schluesseltabellen/create_views.sql index 46d60f2..47f18f7 100644 --- a/src-modules/module/xcube/schluesseltabellen/create_views.sql +++ b/src-modules/module/xcube/schluesseltabellen/create_views.sql @@ -25,3 +25,28 @@ union select druck,apnr,'1' from cifx where key=747 and parent is not null union select druck, '' || astat::integer, bund_apnr from cifx where key=12 and apnr != 'D' union select 'unbekannt' druck, '-9999' apnr, 'alle' as parent from xdummy; + +drop view if exists xcube_hoererstatus; +create view xcube_hoererstatus (druck, apnr, parent) as +select 'Alle'::varchar(255) as druck,'A' as apnr,null::char(10) as parent +from xdummy +union +select 'Haupt-/Nebenhörer'::varchar(255) as druck,'A1' as apnr,'A'::char(10) as parent +from xdummy +union select druck::varchar(255), apnr, 'A1'::char(10) as parent from cifx where key= 613 and astat='1' +union +select 'Zweithörer'::varchar(255) as druck,'A2' as apnr,'A'::char(10) as parent +from xdummy +union select druck::varchar(255), apnr, 'A2'::char(10) as parent from cifx where key= 613 and astat='2' +union +select 'Deutschkurs/Studienkolleg'::varchar(255) as druck,'A3' as apnr,'A'::char(10) as parent +from xdummy +union select druck::varchar(255), apnr, 'A3'::char(10) as parent from cifx where key= 613 and astat='3' +union +select 'Gasthörer'::varchar(255) as druck,'A4' as apnr,'A'::char(10) as parent +from xdummy +union select druck::varchar(255), apnr, 'A4'::char(10) as parent from cifx where key= 613 and astat='4' +union +select 'Sonstige'::varchar(255) as druck,'A99' as apnr,'A'::char(10) as parent +from xdummy +union select druck::varchar(255), apnr, 'A99'::char(10) as parent from cifx where key= 613 and astat not in ('1','2','3','4')