Berichtsassistent
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

84 lines
1.3 KiB

--freemarker Template
<sqlvars>
<sqlvar name="lm_exam_unit_exists">
select sp_table_exists('lm_exam_unit') from xdummy;
</sqlvar>
<sqlvar name="sos_lab_pord_exists">
select sp_table_exists('sos_lab_pord') from xdummy;
</sqlvar>
</sqlvars>
<#if lm_exam_unit_exists=1 && sos_lab_pord_exists=1>
truncate table rpta_exam_unit;
insert into rpta_exam_unit (matrikel_nr,
labnr,
sourcesystem,
tid_stg,
sem_der_pruefung,
note,
fach_sem_zahl,
pstatus,
prueck,
pvermerk,
bonus,
pordnr,
part,
ppflicht,
modulart,
pktxt,
pdtxt,
pversuch,
elementnr,
summe)
SELECT
matrikel_nr,
labnr,
sourcesystem,
tid_stg,
sem_der_pruefung,
note,
fach_sem_zahl,
pstatus,
prueck,
pvermerk,
bonus,
pordnr,
part,
ppflicht,
modulart,
pktxt,
pdtxt,
pversuch,
elementnr,
summe
FROM lm_exam_unit
UNION SELECT
matrikel_nr,
labnr,
sourcesystem,
tid_stg,
sem_der_pruefung,
note,
fach_sem_zahl,
pstatus,
prueck,
pvermerk,
bonus,
pordnr,
part,
ppflicht,
modulart,
pktxt,
pdtxt,
pversuch,
pnr::varchar(255) as elementnr,
summe
FROM sos_lab_pord
WHERE sourcesystem = 5
;
</#if>