|
|
@ -102,7 +102,9 @@ 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); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
select T.*,1::smallint as primaerflag |
|
|
|
select T.*, |
|
|
|
|
|
|
|
1::smallint as primaerflag, |
|
|
|
|
|
|
|
null::integer as letztes_tsg_semester |
|
|
|
into temp tmp_studien2 |
|
|
|
into temp tmp_studien2 |
|
|
|
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 |
|
|
@ -113,7 +115,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::smallint as primaerflag |
|
|
|
select T.*, |
|
|
|
|
|
|
|
0::smallint 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 |
|
|
@ -140,6 +144,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 |
|
|
@ -278,8 +283,8 @@ statustyp_tsg, |
|
|
|
tsg_generated, |
|
|
|
tsg_generated, |
|
|
|
primaerflag, |
|
|
|
primaerflag, |
|
|
|
hzb_art, |
|
|
|
hzb_art, |
|
|
|
fachsemester) |
|
|
|
fachsemester, |
|
|
|
|
|
|
|
letztes_tsg_semester) |
|
|
|
select M.semester, |
|
|
|
select M.semester, |
|
|
|
M.semester_anfang, |
|
|
|
M.semester_anfang, |
|
|
|
M.semester_ende, |
|
|
|
M.semester_ende, |
|
|
@ -310,7 +315,8 @@ 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, |
|
|
|
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 |
|
|
@ -321,7 +327,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 |
|
|
|
; |
|
|
|
; |
|
|
|
|
|
|
|
|
|
|
|
--statustyp und hrst nachladen: |
|
|
|
--statustyp und hrst nachladen: |
|
|
@ -337,15 +343,16 @@ 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 |
|
|
|
; |
|
|
|
; |
|
|
|
|
|
|
|
|
|
|
|
drop table tmp_studien_msg_tsg_fehlend; |
|
|
|
drop table tmp_studien_msg_tsg_fehlend; |
|
|
@ -426,7 +433,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 |
|
|
|
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 |
|
|
|
; |
|
|
|
; |
|
|
|
|
|
|
|
|
|
|
|
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 |
|
|
|