Browse Source

Änderungen bei xcube_hoererstatus

xcube0.1
Marlies Winterstein 2 years ago
parent
commit
e0c243d993
  1. 25
      src-modules/module/xcube/schluesseltabellen/create_views.sql

25
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 druck, '' || astat::integer, bund_apnr from cifx where key=12 and apnr != 'D'
union union
select 'unbekannt' druck, '-9999' apnr, 'alle' as parent from xdummy; 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')

Loading…
Cancel
Save