|
|
@ -41,6 +41,7 @@ null::char(10) as hrst, |
|
|
|
null::integer as fachsemester, |
|
|
|
null::integer as fachsemester, |
|
|
|
null::integer as hssem, |
|
|
|
null::integer as hssem, |
|
|
|
(case when SG.studiengangs_typ_kb in ('TSG') then SA.studienstatustyp else null::char(10) end) as statustyp_tsg, |
|
|
|
(case when SG.studiengangs_typ_kb in ('TSG') then SA.studienstatustyp else null::char(10) end) as statustyp_tsg, |
|
|
|
|
|
|
|
(case when ST.hauptstudium_flag='J' then 1::smallint else 0::smallint end) as primaerflag_studien, |
|
|
|
0::smallint as tsg_generated, |
|
|
|
0::smallint as tsg_generated, |
|
|
|
--0::smallint as primaerflag, |
|
|
|
--0::smallint as primaerflag, |
|
|
|
null::integer as studiengang_nr, |
|
|
|
null::integer as studiengang_nr, |
|
|
@ -51,7 +52,12 @@ null::date as ruebeudat, |
|
|
|
null::date as endedat, |
|
|
|
null::date as endedat, |
|
|
|
null::smallint as kz_rueck_beur_ein, |
|
|
|
null::smallint as kz_rueck_beur_ein, |
|
|
|
null::smallint as kz_rueck_beur_ein_tsg, |
|
|
|
null::smallint as kz_rueck_beur_ein_tsg, |
|
|
|
null::char(10) as hzb_art, |
|
|
|
null::integer as hzb_art_nr, |
|
|
|
|
|
|
|
null::integer as hzb_land_nr, |
|
|
|
|
|
|
|
null::integer as hzb_land_sub_r_nr , |
|
|
|
|
|
|
|
null::integer as hzb_jahr, |
|
|
|
|
|
|
|
null::date as hzb_datum , |
|
|
|
|
|
|
|
null::decimal(14,7) as hzb_note, |
|
|
|
rank () over (partition by SM.st_sem_nr, S.st_studstamm_nr, SG.studiengangs_identifikator order by SA.gueltig_ab desc) as status_historie |
|
|
|
rank () over (partition by SM.st_sem_nr, S.st_studstamm_nr, SG.studiengangs_identifikator order by SA.gueltig_ab desc) as status_historie |
|
|
|
into temp tmp_studien |
|
|
|
into temp tmp_studien |
|
|
|
FROM costage_st_studierendenstammdaten S, |
|
|
|
FROM costage_st_studierendenstammdaten S, |
|
|
@ -97,37 +103,58 @@ and F.fachsemestertyp='FS' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
update tmp_studien |
|
|
|
update tmp_studien |
|
|
|
set hzb_art=H.hzb_art_stla_code |
|
|
|
set hzb_art_nr=H.hzb_art_nr, |
|
|
|
from costage_bw_bewerb_hzb H, costage_bw_bewerbungen BW |
|
|
|
hzb_datum=H.hzb_datum, |
|
|
|
where tmp_studien.st_studstamm_nr = BW.st_studstamm_nr |
|
|
|
hzb_note=(case when substring(H.hzb_note from 1 for 1) ~ '[0-9]' |
|
|
|
and BW.nr=H.bw_bewrbng_nr |
|
|
|
and substring(H.hzb_note from 2 for 1) in (',','.') |
|
|
|
|
|
|
|
and substring(H.hzb_note from 3 for 1) ~ '[0-9]' |
|
|
|
|
|
|
|
and (substring(H.hzb_note from 4 for 1) ~ '[0-9]' or substring(H.hzb_note from 4 for 1)='') |
|
|
|
|
|
|
|
and length(H.hzb_note)<=4 then to_number(replace(H.hzb_note,',','.'),'9.99') else null::decimal(8,4) end ), |
|
|
|
|
|
|
|
hzb_land_sub_r_nr=H.hzb_land_sub_r_nr, |
|
|
|
|
|
|
|
hzb_land_nr=H.hzb_land_nr, |
|
|
|
|
|
|
|
hzb_jahr=H.hzb_jahr |
|
|
|
|
|
|
|
from costage_st_hzb H |
|
|
|
|
|
|
|
where tmp_studien.st_studstamm_nr = H.st_person_nr |
|
|
|
; |
|
|
|
; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
create index tmp_ix1 on tmp_studien(st_studiengang_nr); |
|
|
|
create index tmp_ix1 on tmp_studien(st_studiengang_nr); |
|
|
|
create index tmp_ix2 on tmp_studien(st_studstamm_nr); |
|
|
|
create index tmp_ix2 on tmp_studien(st_studstamm_nr); |
|
|
|
create index tmp_ix3 on tmp_studien(studiengangs_typ_kb); |
|
|
|
create index tmp_ix3 on tmp_studien(studiengangs_typ_kb); |
|
|
|
create index tmp_ix4 on tmp_studien(st_sem_nr); |
|
|
|
create index tmp_ix4 on tmp_studien(st_sem_nr); |
|
|
|
create index tmp_ix5 on tmp_studien(status_historie); |
|
|
|
create index tmp_ix5 on tmp_studien(status_historie); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--Primärflag ermitteln: |
|
|
|
select T.*,1::smallint as primaerflag |
|
|
|
--1. Prio: aus px_st_studien_v: |
|
|
|
|
|
|
|
select T.*,1::integer as primaerflag |
|
|
|
into temp tmp_studien2 |
|
|
|
into temp tmp_studien2 |
|
|
|
|
|
|
|
from tmp_studien T |
|
|
|
|
|
|
|
where T.status_historie=1 |
|
|
|
|
|
|
|
and T.studiengangs_typ_kb in ('ESG','TSG') |
|
|
|
|
|
|
|
and T.primaerflag_studien=1 |
|
|
|
|
|
|
|
; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--2. Prio: aus costage_st_hauptstudien: |
|
|
|
|
|
|
|
insert into tmp_studien2 |
|
|
|
|
|
|
|
select T.*,1::integer as primaerflag |
|
|
|
from tmp_studien T, costage_st_hauptstudien H |
|
|
|
from tmp_studien T, costage_st_hauptstudien H |
|
|
|
where H.st_studstamm_nr=T.st_studstamm_nr |
|
|
|
where H.st_studstamm_nr=T.st_studstamm_nr |
|
|
|
and H.st_studium_nr=T.st_studium_nr |
|
|
|
and H.st_studium_nr=T.st_studium_nr |
|
|
|
and H.st_sem_nr=T.st_sem_nr |
|
|
|
and H.st_sem_nr=T.st_sem_nr |
|
|
|
and status_historie=1 |
|
|
|
and status_historie=1 |
|
|
|
and T.studiengangs_typ_kb in ('ESG','TSG') |
|
|
|
and T.studiengangs_typ_kb in ('ESG','TSG') |
|
|
|
|
|
|
|
and T.primaerflag_studien=0 |
|
|
|
; |
|
|
|
; |
|
|
|
--Studiengänge ohne Primärflag: |
|
|
|
--Studiengänge ohne Primärflag: |
|
|
|
insert into tmp_studien2 |
|
|
|
insert into tmp_studien2 |
|
|
|
select T.*,0::smallint as primaerflag |
|
|
|
select T.*,0::integer as primaerflag |
|
|
|
from tmp_studien T left outer join costage_st_hauptstudien H |
|
|
|
from tmp_studien T left outer join costage_st_hauptstudien H |
|
|
|
on (H.st_studstamm_nr=T.st_studstamm_nr |
|
|
|
on (H.st_studstamm_nr=T.st_studstamm_nr |
|
|
|
and H.st_studium_nr=T.st_studium_nr |
|
|
|
and H.st_studium_nr=T.st_studium_nr |
|
|
|
and H.st_sem_nr=T.st_sem_nr) |
|
|
|
and H.st_sem_nr=T.st_sem_nr) |
|
|
|
where T.status_historie=1 |
|
|
|
where T.status_historie=1 |
|
|
|
and T.studiengangs_typ_kb in ('ESG','TSG') |
|
|
|
and T.studiengangs_typ_kb in ('ESG','TSG') |
|
|
|
|
|
|
|
and T.primaerflag_studien=0 |
|
|
|
and H.st_studstamm_nr is null |
|
|
|
and H.st_studstamm_nr is null |
|
|
|
; |
|
|
|
; |
|
|
|
|
|
|
|
|
|
|
@ -285,7 +312,11 @@ hssem, |
|
|
|
statustyp_tsg, |
|
|
|
statustyp_tsg, |
|
|
|
tsg_generated, |
|
|
|
tsg_generated, |
|
|
|
primaerflag, |
|
|
|
primaerflag, |
|
|
|
hzb_art, |
|
|
|
hzb_art_nr, |
|
|
|
|
|
|
|
hzb_land_sub_r_nr , |
|
|
|
|
|
|
|
hzb_jahr, |
|
|
|
|
|
|
|
hzb_datum , |
|
|
|
|
|
|
|
hzb_note, |
|
|
|
fachsemester) |
|
|
|
fachsemester) |
|
|
|
|
|
|
|
|
|
|
|
select M.semester, |
|
|
|
select M.semester, |
|
|
@ -317,7 +348,11 @@ S.hssem, |
|
|
|
null::char(10) as statustyp_tsg, |
|
|
|
null::char(10) as statustyp_tsg, |
|
|
|
1 as tsg_generated, |
|
|
|
1 as tsg_generated, |
|
|
|
0 as primaerflag, --geschlossene TSG können kein Primärflag haben |
|
|
|
0 as primaerflag, --geschlossene TSG können kein Primärflag haben |
|
|
|
S.hzb_art, |
|
|
|
S.hzb_art_nr, |
|
|
|
|
|
|
|
S.hzb_land_sub_r_nr , |
|
|
|
|
|
|
|
S.hzb_jahr, |
|
|
|
|
|
|
|
S.hzb_datum , |
|
|
|
|
|
|
|
S.hzb_note, |
|
|
|
max(S.fachsemester) |
|
|
|
max(S.fachsemester) |
|
|
|
from tmp_studien_msg_tsg_fehlend M, tmp_studien3 S --,costage_st_semester E |
|
|
|
from tmp_studien_msg_tsg_fehlend M, tmp_studien3 S --,costage_st_semester E |
|
|
|
where M.st_studiengang_nr_msg=S.st_studiengang_nr_msg_possible |
|
|
|
where M.st_studiengang_nr_msg=S.st_studiengang_nr_msg_possible |
|
|
@ -329,7 +364,7 @@ and M.semester != S.semester |
|
|
|
--and S.st_studiengang_nr_msg=34454 |
|
|
|
--and S.st_studiengang_nr_msg=34454 |
|
|
|
--and S.studiengangs_bezeichnung='Bildungswissenschaften' |
|
|
|
--and S.studiengangs_bezeichnung='Bildungswissenschaften' |
|
|
|
--and M.semester=20211 |
|
|
|
--and M.semester=20211 |
|
|
|
group by 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,23,24,25,26 |
|
|
|
group by 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,23,24,25,26,27,28,29,30 |
|
|
|
; |
|
|
|
; |
|
|
|
|
|
|
|
|
|
|
|
--statustyp und hrst nachladen: |
|
|
|
--statustyp und hrst nachladen: |
|
|
@ -434,7 +469,7 @@ into temp tmp_studien3 |
|
|
|
from tmp_studien2 T left outer join costage_st_studien_spoversionen SPO |
|
|
|
from tmp_studien2 T left outer join costage_st_studien_spoversionen SPO |
|
|
|
on (SPO.st_studium_nr=T.st_studium_nr |
|
|
|
on (SPO.st_studium_nr=T.st_studium_nr |
|
|
|
and SPO.gueltig_ab < T.semester_ende) |
|
|
|
and SPO.gueltig_ab < T.semester_ende) |
|
|
|
group by 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42 |
|
|
|
group by 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48 |
|
|
|
; |
|
|
|
; |
|
|
|
|
|
|
|
|
|
|
|
update tmp_studien3 set po_stp_stp_version_kb= SPO.po_stp_stp_version_kb |
|
|
|
update tmp_studien3 set po_stp_stp_version_kb= SPO.po_stp_stp_version_kb |
|
|
@ -481,7 +516,12 @@ st_studium_nr, |
|
|
|
stufrm, |
|
|
|
stufrm, |
|
|
|
kz_rueck_beur_ein, |
|
|
|
kz_rueck_beur_ein, |
|
|
|
kz_rueck_beur_ein_tsg, |
|
|
|
kz_rueck_beur_ein_tsg, |
|
|
|
hzb_art, |
|
|
|
hzb_land_nr, |
|
|
|
|
|
|
|
hzb_land_sub_r_nr, |
|
|
|
|
|
|
|
hzb_art_nr, |
|
|
|
|
|
|
|
hzb_jahr, |
|
|
|
|
|
|
|
hzb_datum, |
|
|
|
|
|
|
|
hzb_note, |
|
|
|
po_stp_stp_version_kb, |
|
|
|
po_stp_stp_version_kb, |
|
|
|
summe |
|
|
|
summe |
|
|
|
) |
|
|
|
) |
|
|
@ -521,7 +561,12 @@ select st_studium_nr, |
|
|
|
studienform_statistik_code as stufrm, |
|
|
|
studienform_statistik_code as stufrm, |
|
|
|
kz_rueck_beur_ein, |
|
|
|
kz_rueck_beur_ein, |
|
|
|
kz_rueck_beur_ein_tsg, |
|
|
|
kz_rueck_beur_ein_tsg, |
|
|
|
hzb_art, |
|
|
|
hzb_land_nr, |
|
|
|
|
|
|
|
hzb_land_sub_r_nr, |
|
|
|
|
|
|
|
hzb_art_nr, |
|
|
|
|
|
|
|
hzb_jahr, |
|
|
|
|
|
|
|
hzb_datum, |
|
|
|
|
|
|
|
hzb_note, |
|
|
|
po_stp_stp_version_kb, |
|
|
|
po_stp_stp_version_kb, |
|
|
|
1 as summe |
|
|
|
1 as summe |
|
|
|
from tmp_studien3 |
|
|
|
from tmp_studien3 |
|
|
@ -554,7 +599,12 @@ st_studium_nr, |
|
|
|
stufrm, |
|
|
|
stufrm, |
|
|
|
kz_rueck_beur_ein, |
|
|
|
kz_rueck_beur_ein, |
|
|
|
kz_rueck_beur_ein_tsg, |
|
|
|
kz_rueck_beur_ein_tsg, |
|
|
|
hzb_art, |
|
|
|
hzb_land_nr, |
|
|
|
|
|
|
|
hzb_land_sub_r_nr, |
|
|
|
|
|
|
|
hzb_art_nr, |
|
|
|
|
|
|
|
hzb_jahr, |
|
|
|
|
|
|
|
hzb_datum, |
|
|
|
|
|
|
|
hzb_note, |
|
|
|
po_stp_stp_version_kb, |
|
|
|
po_stp_stp_version_kb, |
|
|
|
summe |
|
|
|
summe |
|
|
|
) |
|
|
|
) |
|
|
@ -595,7 +645,12 @@ cast (NULL as int) as studiengang_nr2, |
|
|
|
studienform_statistik_code as stufrm, |
|
|
|
studienform_statistik_code as stufrm, |
|
|
|
kz_rueck_beur_ein, |
|
|
|
kz_rueck_beur_ein, |
|
|
|
kz_rueck_beur_ein_tsg, |
|
|
|
kz_rueck_beur_ein_tsg, |
|
|
|
hzb_art, |
|
|
|
hzb_land_nr, |
|
|
|
|
|
|
|
hzb_land_sub_r_nr, |
|
|
|
|
|
|
|
hzb_art_nr, |
|
|
|
|
|
|
|
hzb_jahr, |
|
|
|
|
|
|
|
hzb_datum, |
|
|
|
|
|
|
|
hzb_note, |
|
|
|
po_stp_stp_version_kb, |
|
|
|
po_stp_stp_version_kb, |
|
|
|
1 as summe |
|
|
|
1 as summe |
|
|
|
from tmp_studien3 |
|
|
|
from tmp_studien3 |
|
|
@ -605,16 +660,6 @@ cast (NULL as int) as studiengang_nr2, |
|
|
|
; |
|
|
|
; |
|
|
|
--HZB Data: |
|
|
|
--HZB Data: |
|
|
|
|
|
|
|
|
|
|
|
update costage_st_studien_aggr set hzb_art=H.hzb_art_stla_code, |
|
|
|
|
|
|
|
hzb_datum=H.zeugnisdatum, |
|
|
|
|
|
|
|
hzb_note=H.hzb_note, |
|
|
|
|
|
|
|
hzb_ort=H.land_sub_r_nr, |
|
|
|
|
|
|
|
hzb_staat=H.land_nr |
|
|
|
|
|
|
|
from costage_bw_bewerb_hzb H, costage_bw_bewerbungen BW |
|
|
|
|
|
|
|
where BW.nr=H.bw_bewrbng_nr |
|
|
|
|
|
|
|
and costage_st_studien_aggr.st_studstamm_nr=BW.st_studstamm_nr |
|
|
|
|
|
|
|
and costage_st_studien_aggr.semester >= ${beginn_semester} |
|
|
|
|
|
|
|
; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--Abmeldungsart: |
|
|
|
--Abmeldungsart: |
|
|
|
--zuerst personbezogen: |
|
|
|
--zuerst personbezogen: |
|
|
|