|
|
@ -126,7 +126,9 @@ create index tmp_ix5 on tmp_studien(status_historie); |
|
|
|
|
|
|
|
|
|
|
|
--Primärflag ermitteln: |
|
|
|
--Primärflag ermitteln: |
|
|
|
--1. Prio: aus px_st_studien_v: |
|
|
|
--1. Prio: aus px_st_studien_v: |
|
|
|
select T.*,1::integer as primaerflag |
|
|
|
select T.*, |
|
|
|
|
|
|
|
1::integer as primaerflag, |
|
|
|
|
|
|
|
null::integer as letztes_tsg_semester |
|
|
|
into temp tmp_studien2 |
|
|
|
into temp tmp_studien2 |
|
|
|
from tmp_studien T |
|
|
|
from tmp_studien T |
|
|
|
where T.status_historie=1 |
|
|
|
where T.status_historie=1 |
|
|
@ -136,7 +138,9 @@ from tmp_studien T |
|
|
|
|
|
|
|
|
|
|
|
--2. Prio: aus costage_st_hauptstudien: |
|
|
|
--2. Prio: aus costage_st_hauptstudien: |
|
|
|
insert into tmp_studien2 |
|
|
|
insert into tmp_studien2 |
|
|
|
select T.*,1::integer as primaerflag |
|
|
|
select T.*, |
|
|
|
|
|
|
|
1::integer as primaerflag, |
|
|
|
|
|
|
|
null::integer as letztes_tsg_semester |
|
|
|
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 |
|
|
@ -147,7 +151,9 @@ from tmp_studien T, costage_st_hauptstudien H |
|
|
|
; |
|
|
|
; |
|
|
|
--Studiengänge ohne Primärflag: |
|
|
|
--Studiengänge ohne Primärflag: |
|
|
|
insert into tmp_studien2 |
|
|
|
insert into tmp_studien2 |
|
|
|
select T.*,0::integer as primaerflag |
|
|
|
select T.*, |
|
|
|
|
|
|
|
0::integer as primaerflag, |
|
|
|
|
|
|
|
null::integer as letztes_tsg_semester |
|
|
|
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 |
|
|
@ -175,6 +181,7 @@ group by 1,2,3 |
|
|
|
--; |
|
|
|
--; |
|
|
|
|
|
|
|
|
|
|
|
--zuerst den jeweils letzten (=jüngsten) MSG zuweisen: |
|
|
|
--zuerst den jeweils letzten (=jüngsten) MSG zuweisen: |
|
|
|
|
|
|
|
--TODO: langsam: |
|
|
|
update tmp_studien2 set st_studiengang_nr_msg=T.st_studiengang_nr_msg |
|
|
|
update tmp_studien2 set st_studiengang_nr_msg=T.st_studiengang_nr_msg |
|
|
|
from tmp_studien T,tmp_last_msg_per_term E, costage_st_studiengaenge_mtsg M |
|
|
|
from tmp_studien T,tmp_last_msg_per_term E, costage_st_studiengaenge_mtsg M |
|
|
|
where M.st_studiengang_nr_tsg=tmp_studien2.st_studiengang_nr |
|
|
|
where M.st_studiengang_nr_tsg=tmp_studien2.st_studiengang_nr |
|
|
@ -317,8 +324,8 @@ hzb_land_sub_r_nr , |
|
|
|
hzb_jahr, |
|
|
|
hzb_jahr, |
|
|
|
hzb_datum , |
|
|
|
hzb_datum , |
|
|
|
hzb_note, |
|
|
|
hzb_note, |
|
|
|
fachsemester) |
|
|
|
fachsemester, |
|
|
|
|
|
|
|
letztes_tsg_semester) |
|
|
|
select M.semester, |
|
|
|
select M.semester, |
|
|
|
M.semester_anfang, |
|
|
|
M.semester_anfang, |
|
|
|
M.semester_ende, |
|
|
|
M.semester_ende, |
|
|
@ -353,7 +360,8 @@ S.hzb_land_sub_r_nr , |
|
|
|
S.hzb_jahr, |
|
|
|
S.hzb_jahr, |
|
|
|
S.hzb_datum , |
|
|
|
S.hzb_datum , |
|
|
|
S.hzb_note, |
|
|
|
S.hzb_note, |
|
|
|
max(S.fachsemester) |
|
|
|
null::integer as fachsemester, |
|
|
|
|
|
|
|
max(S.semester) |
|
|
|
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 |
|
|
|
and M.st_studiengang_nr_tsg=S.st_studiengang_nr |
|
|
|
and M.st_studiengang_nr_tsg=S.st_studiengang_nr |
|
|
@ -364,7 +372,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,27,28,29,30 |
|
|
|
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 |
|
|
|
; |
|
|
|
; |
|
|
|
|
|
|
|
|
|
|
|
--statustyp und hrst nachladen: |
|
|
|
--statustyp und hrst nachladen: |
|
|
@ -380,14 +388,15 @@ and S.status_historie=1 |
|
|
|
|
|
|
|
|
|
|
|
; |
|
|
|
; |
|
|
|
|
|
|
|
|
|
|
|
--statustyp_stg nachladen: |
|
|
|
--statustyp_tsg nachladen: |
|
|
|
update tmp_studien2 set statustyp_tsg=S.statustyp_tsg |
|
|
|
update tmp_studien2 set statustyp_tsg=S.statustyp_tsg, |
|
|
|
|
|
|
|
fachsemester=S.fachsemester |
|
|
|
from tmp_studien S |
|
|
|
from tmp_studien S |
|
|
|
where tmp_studien2.st_studium_nr=S.st_studium_nr |
|
|
|
where tmp_studien2.st_studium_nr=S.st_studium_nr |
|
|
|
and tmp_studien2.st_studstamm_nr=S.st_studstamm_nr |
|
|
|
and tmp_studien2.st_studstamm_nr=S.st_studstamm_nr |
|
|
|
and S.studiengangs_typ_kb ='TSG' |
|
|
|
and S.studiengangs_typ_kb ='TSG' |
|
|
|
and tmp_studien2.tsg_generated=1 |
|
|
|
and tmp_studien2.tsg_generated=1 |
|
|
|
and tmp_studien2.fachsemester=S.fachsemester |
|
|
|
and tmp_studien2.letztes_tsg_semester=S.semester |
|
|
|
and S.status_historie=1 |
|
|
|
and S.status_historie=1 |
|
|
|
; |
|
|
|
; |
|
|
|
|
|
|
|
|
|
|
@ -469,7 +478,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,43,44,45,46,47,48 |
|
|
|
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,49 |
|
|
|
; |
|
|
|
; |
|
|
|
|
|
|
|
|
|
|
|
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 |
|
|
|