Browse Source

cifx_customize für alle cifx Schlüssel aktivieren #275459

master
Daniel Quathamer 6 days ago
parent
commit
8442ae87cd
  1. 4
      superx/WEB-INF/conf/edustore/db/install/conf/kern.xml
  2. 1
      superx/WEB-INF/conf/edustore/db/install/masken/71620_felderinfo.unl
  3. 1
      superx/WEB-INF/conf/edustore/db/install/masken/71620_masken_felder_bez.unl
  4. 532
      superx/WEB-INF/conf/edustore/db/install/schluesseltabellen/release_unloads/fm_templates.unl

4
superx/WEB-INF/conf/edustore/db/install/conf/kern.xml

@ -1380,7 +1380,7 @@
notnull="false" description="Schlüssel (Anzeige)" currentlyUsed="false"/> notnull="false" description="Schlüssel (Anzeige)" currentlyUsed="false"/>
<column name="sort1" type="INTEGER" size="4" default="" <column name="sort1" type="INTEGER" size="4" default=""
notnull="false" /> notnull="false" />
<column name="struktur_c" type="CHAR" size="50" default="" <column name="struktur_c" description="Struktur-String" type="VARCHAR" size="50" default=""
notnull="false" /> notnull="false" />
</columns> </columns>
<indexes> <indexes>
@ -12292,7 +12292,7 @@ mode="full">
<customfield name="kurz" nullFieldValue="" visibleSize="20" /> <customfield name="kurz" nullFieldValue="" visibleSize="20" />
<customfield name="druck" nullFieldValue="" visibleSize="20" /> <customfield name="druck" nullFieldValue="" visibleSize="20" />
<customfield name="lang_1" nullFieldValue="" visibleSize="20" /> <customfield name="lang_1" nullFieldValue="" visibleSize="20" />
<!--<customfield name="uniquename" nullFieldValue="" visibleSize="3" />--> <customfield name="struktur_c" nullFieldValue="" visibleSize="20" />
</form> </form>
</dbforms> </dbforms>
</module> </module>

1
superx/WEB-INF/conf/edustore/db/install/masken/71620_felderinfo.unl

@ -1,5 +1,6 @@
71620^Schlüssel^4^0^0^150^200^1^integer^200^0^1^<<SQL>> SELECT distinct C.key, nvl(trim(I.druck) || '- ' ,'') || C.key\ 71620^Schlüssel^4^0^0^150^200^1^integer^200^0^1^<<SQL>> SELECT distinct C.key, nvl(trim(I.druck) || '- ' ,'') || C.key\
from cifx C left outer join cif I on (I.apnr=C.key and I.key=2) order by 2^ ^ ^ from cifx C left outer join cif I on (I.apnr=C.key and I.key=2) order by 2^ ^ ^
71621^Ausprägung^0^0^0^150^80^1^sql^200^0^0^^ ^ ^ 71621^Ausprägung^0^0^0^150^80^1^sql^200^0^0^^ ^ ^
71622^Stammdaten anpassen^100^0^0^140^80^1^char^255^0^18^ ^ ^<<SQL>> select '../edit/kern/cifx_customize_list.jsp' from xdummy;^
71623^Drucktext^4^0^0^150^120^1^sql^50^0^0^^ ^ ^ 71623^Drucktext^4^0^0^150^120^1^sql^50^0^0^^ ^ ^
71624^Institution^4^0^0^150^200^1^char^200^0^13^^ ^ ^ 71624^Institution^4^0^0^150^200^1^char^200^0^13^^ ^ ^

1
superx/WEB-INF/conf/edustore/db/install/masken/71620_masken_felder_bez.unl

@ -1,4 +1,5 @@
71620^71620^ 71620^71620^
71620^71621^ 71620^71621^
71620^71622^
71620^71623^ 71620^71623^
71620^71624^ 71620^71624^

532
superx/WEB-INF/conf/edustore/db/install/schluesseltabellen/release_unloads/fm_templates.unl

@ -1,4 +1,4 @@
333^SuperX_general^<#-- General FreeMarker Makros für SuperX -->\ 176^SuperX_general^<#-- General FreeMarker Makros für SuperX -->\
<#-- Einfügen eines Kommentars Die Kommentarverwaltung ist ja ziemlich abgefahren in SuperX.\ <#-- Einfügen eines Kommentars Die Kommentarverwaltung ist ja ziemlich abgefahren in SuperX.\
Standardmäßig werden Kommentare gelöscht, damit nicht soviel an die DB geschickt wird.\ Standardmäßig werden Kommentare gelöscht, damit nicht soviel an die DB geschickt wird.\
Wenn man aber bei Entwicklungszwecken noch Kommentare drin haben will, kann man diese Funktion benutzen.\ Wenn man aber bei Entwicklungszwecken noch Kommentare drin haben will, kann man diese Funktion benutzen.\
@ -247,7 +247,7 @@ ORDER BY ${businessKey} \
\ \
DROP TABLE ${coreTableName}_input; \ DROP TABLE ${coreTableName}_input; \
</#macro>^allgemeine SuperX-Makros^^1^ </#macro>^allgemeine SuperX-Makros^^1^
334^SQL_lingua_franca^<#-- \ 177^SQL_lingua_franca^<#-- \
lingua franca makros um von SQL Dialekten (Informix/Postgres) unabhängig zu werden \ lingua franca makros um von SQL Dialekten (Informix/Postgres) unabhängig zu werden \
Stand 4.4.05\ Stand 4.4.05\
FreeMarker Kommentare dieser Art werden von generateSql verschandelt\ FreeMarker Kommentare dieser Art werden von generateSql verschandelt\
@ -412,7 +412,7 @@ execute ${varname};\
char\ char\
</#if> \ </#if> \
</#macro>^Datenbankunabhängigkeit^^2^ </#macro>^Datenbankunabhängigkeit^^2^
335^KERN_CIFX_UPDATE^<#macro tmp_cifx2_apnr_duplikate_nullen>\ 178^KERN_CIFX_UPDATE^<#macro tmp_cifx2_apnr_duplikate_nullen>\
CREATE TEMP TABLE tmp_doppelt\ CREATE TEMP TABLE tmp_doppelt\
(\ (\
key integer,\ key integer,\
@ -959,14 +959,13 @@ update ${target_table} set d_akt_bis=date_val('01.01.2900') where d_akt_bis is n
\ \
<#-- Kommentarblock BEGINN: (JoWi) scheinbar gibt es noch eine 'cifx_customize', in der ergänzende Anpassungen an der 'cifx' hinterlegt werden können!? In den Musterdaten allerdings leer... -->\ <#-- Kommentarblock BEGINN: (JoWi) scheinbar gibt es noch eine 'cifx_customize', in der ergänzende Anpassungen an der 'cifx' hinterlegt werden können!? In den Musterdaten allerdings leer... -->\
--Customize?\ --Customize?\
<#assign cifx_cols = ["kurz", "druck", "lang_1"]>\ <#assign cifx_cols = ["kurz", "druck", "lang_1","struktur_c"]>\
<#list cifx_cols as cifx_col>\ <#list cifx_cols as cifx_col>\
update ${target_table} set ${cifx_col}=(select min(${cifx_col}) from cifx_customize C\ update ${target_table} set ${cifx_col}=(select min(${cifx_col}) from cifx_customize C\
where C.cifx_table='${target_table}'\ where C.cifx_table='${target_table}'\
and C.apnr=${target_table}.apnr\ and C.apnr=${target_table}.apnr\
and C.key=${target_table}.key)\ and C.key=${target_table}.key)\
where ${target_table}.key=35\ where (${target_table}.key,${target_table}.apnr) in (select C2.key,C2.apnr from cifx_customize C2\
and ${target_table}.apnr in (select C2.apnr from cifx_customize C2\
where C2.cifx_table='${target_table}'\ where C2.cifx_table='${target_table}'\
and C2.key=${target_table}.key\ and C2.key=${target_table}.key\
and C2.${cifx_col} is not null \ and C2.${cifx_col} is not null \
@ -1605,6 +1604,7 @@ CREATE TEMP TABLE tmp_schluessel\
);\ );\
\ \
CREATE INDEX ix_tmp_schluessel ON tmp_schluessel(mschluessel,aschluessel);\ CREATE INDEX ix_tmp_schluessel ON tmp_schluessel(mschluessel,aschluessel);\
CREATE INDEX ix_tmp_schluessel2 ON tmp_schluessel(aschluessel_orig);\
\ \
CREATE TEMP TABLE tmp_schluessel2\ CREATE TEMP TABLE tmp_schluessel2\
(\ (\
@ -1818,6 +1818,8 @@ WHERE\
aschluessel IS NULL\ aschluessel IS NULL\
AND mschluessel = ${merkmal.key};\ AND mschluessel = ${merkmal.key};\
\ \
CREATE INDEX ix_tmp_keygen ON tmp_keygen(sourcesystem_id);\
\
<#if debug_merkmal >\ <#if debug_merkmal >\
CREATE TABLE dim_bp_apnr_fuellen_debug.mm_${merkmal.key}_8_tmp_keygen AS SELECT * FROM tmp_keygen;\ CREATE TABLE dim_bp_apnr_fuellen_debug.mm_${merkmal.key}_8_tmp_keygen AS SELECT * FROM tmp_keygen;\
</#if>\ </#if>\
@ -1910,6 +1912,8 @@ from tmp_schluessel\
group by 1,2\ group by 1,2\
having count(*)>1;\ having count(*)>1;\
\ \
CREATE INDEX ix_tmp_doppelt ON tmp_doppelt(mschluessel,aschluessel);\
\
update tmp_doppelt set auspraegung=(select min(S.auspraegung)\ update tmp_doppelt set auspraegung=(select min(S.auspraegung)\
from tmp_schluessel S\ from tmp_schluessel S\
where S.mschluessel = tmp_doppelt.mschluessel and S.aschluessel = tmp_doppelt.aschluessel );\ where S.mschluessel = tmp_doppelt.mschluessel and S.aschluessel = tmp_doppelt.aschluessel );\
@ -2227,15 +2231,15 @@ aschluessel,\
--also ID vergeben:\ --also ID vergeben:\
--derzeitigen Maximal-Wert ermitteln:\ --derzeitigen Maximal-Wert ermitteln:\
insert into tmp_hilf select max(apnr) from\ insert into tmp_hilf select max(apnr) from\
(select max(A.apnr) \ (select max(A.apnr::INT) AS apnr \
from dim_bp_apnr A,dimension D\ from dim_bp_apnr A,dimension D\
where A.dimension_bp_id=D.dimension_bp_id\ where A.dimension_bp_id=D.dimension_bp_id\
and D.system_key='${merkmal.key}'\ and D.system_key='${merkmal.key}'\
and A.apnr < 99998\ and A.apnr < 99998\
union\ union\
select max(aschluessel) from tmp_schluessel\ select max(aschluessel::INT) AS apnr from tmp_schluessel\
where mschluessel=${merkmal.key} and aschluessel < 9998\ where mschluessel=${merkmal.key} and aschluessel < 9998\
) as apnr;\ );\
\ \
update tmp_hilf set tid=0 where tid is null;\ update tmp_hilf set tid=0 where tid is null;\
--die neuen Schlüssel einfügen:\ --die neuen Schlüssel einfügen:\
@ -2500,7 +2504,7 @@ DROP TABLE tmp_schluessel2;\
DROP TABLE tmp_doppelt;\ DROP TABLE tmp_doppelt;\
DROP TABLE tmp_merkmale;\ DROP TABLE tmp_merkmale;\
</#macro>^Makro cifx-update^^1^ </#macro>^Makro cifx-update^^1^
336^SQL_multitable_output^<#--\ 179^SQL_multitable_output^<#--\
Utility Makros für die Maske 71280 Tabelle ausgeben und Derivate (z.B. 17110 Sekundärinfo Datenblatt )\ Utility Makros für die Maske 71280 Tabelle ausgeben und Derivate (z.B. 17110 Sekundärinfo Datenblatt )\
(c)2011 Daniel Quathamer\ (c)2011 Daniel Quathamer\
\ \
@ -2842,7 +2846,7 @@ from tmp_tabelle\
;\ ;\
</#if>\ </#if>\
</#macro>^Utility Makros Tabelleninhalte Ausgeben für die Maske 16650 (Studierende Datenblatt) und Derivate^(c)2011 Daniel Quathamer^1^ </#macro>^Utility Makros Tabelleninhalte Ausgeben für die Maske 16650 (Studierende Datenblatt) und Derivate^(c)2011 Daniel Quathamer^1^
337^SQL_table_output^<#--\ 180^SQL_table_output^<#--\
Utility Makros für die Maske 71280 Tabelle ausgeben und Derivate (z.B. 17110 Sekundärinfo Datenblatt )\ Utility Makros für die Maske 71280 Tabelle ausgeben und Derivate (z.B. 17110 Sekundärinfo Datenblatt )\
(c)2011 Daniel Quathamer\ (c)2011 Daniel Quathamer\
\ \
@ -3059,7 +3063,7 @@ ${feldname}\
from tmp_tabelle;\ from tmp_tabelle;\
</#if>\ </#if>\
</#macro>^Datenbankunabhängigkeit^^1^ </#macro>^Datenbankunabhängigkeit^^1^
338^DatenblattSQLGenerator^<#--\ 181^DatenblattSQLGenerator^<#--\
Utility Makro Datenblatt-Berichte\ Utility Makro Datenblatt-Berichte\
(c)2023 Daniel Quathamer\ (c)2023 Daniel Quathamer\
\ \
@ -3251,3 +3255,507 @@ order by <#list 1..p_selectClause?size as i>${i}\
\ \
\ \
</#macro>^Utility Makros Tabelleninhalte Ausgeben für Datenblatt-Berichte^(c)2023 Daniel Quathamer^1^ </#macro>^Utility Makros Tabelleninhalte Ausgeben für Datenblatt-Berichte^(c)2023 Daniel Quathamer^1^
182^ETL_MAKROS^<#macro ETL_STEPS_FUELLEN>\
<@etl_steps_def_check/>\
\
<#-- Hinterlegen von Defaultwerten für step_properties -->\
<#assign new_etl_step_properties = etl_step_properties>\
<#foreach step in etl_steps>\
<#-- gültig für alle Steps -->\
<#if etl_step_lookup_systeminfo(step.etl_job)==-1><#stop "DEFINITIONSFEHLER: Etl_step '"+step.uniquename+ "' verweist auf job '"+step.etl_job+"' der liefert aber keine systeminfo_id"> </#if>\
<@check_etl_properties step_uniquename=step.uniquename propname="systemInfoId" defaultvalue=etl_step_lookup_systeminfo(step.etl_job)/>\
<@check_etl_properties step_uniquename=step.uniquename propname="active" defaultvalue="true"/>\
<@check_etl_properties step_uniquename=step.uniquename propname="custom" defaultvalue="true"/>\
\
<#switch step.type>\
<#case "UNLOAD">\
<@check_etl_properties step_uniquename=step.uniquename propname="sourceVersions" defaultvalue=""/>\
<@check_etl_properties step_uniquename=step.uniquename propname="sqlVarSource" defaultvalue="eduetl"/>\
<#break>\
<#case "LOAD">\
<@check_etl_properties step_uniquename=step.uniquename propname="database" defaultvalue="eduetl"/>\
<@check_etl_properties step_uniquename=step.uniquename propname="delimiter" defaultvalue="\^"/>\
<@check_etl_properties step_uniquename=step.uniquename propname="header" defaultvalue="false"/>\
<@check_etl_properties step_uniquename=step.uniquename propname="refresh" defaultvalue="true"/>\
<@check_etl_properties step_uniquename=step.uniquename propname="usePostgresCopyApi" defaultvalue="true"/>\
<#break>\
<#case "DOQUERY">\
<@check_etl_properties step_uniquename=step.uniquename propname="databaseSystem" defaultvalue="postgres"/>\
<@check_etl_properties step_uniquename=step.uniquename propname="dataSource" defaultvalue="eduetl"/>\
<@check_etl_properties step_uniquename=step.uniquename propname="sourceVersions" defaultvalue=""/>\
<@check_etl_properties step_uniquename=step.uniquename propname="sqlVarDataSource" defaultvalue="eduetl"/>\
<#break>\
<#case "DOSQL">\
<@check_etl_properties step_uniquename=step.uniquename propname="databaseSystem" defaultvalue="postgres"/>\
<@check_etl_properties step_uniquename=step.uniquename propname="dataSource" defaultvalue="eduetl"/>\
<@check_etl_properties step_uniquename=step.uniquename propname="sqlVarDataSource" defaultvalue="eduetl"/>\
<@check_etl_properties step_uniquename=step.uniquename propname="limitDebugStmts" defaultvalue="-1"/>\
<#break>\
<#default>\
\
</#switch>\
</#foreach>\
<#assign etl_step_properties = new_etl_step_properties>\
\
\
--Bezeichnungen aktualisieren\
<#foreach etl_job in etl_jobs>\
update etl_job set caption='${etl_job.name}' where uniquename='${etl_job.uniquename}'; -- ggfs noch systeminfo_id?\
</#foreach>\
<#foreach etl_step in etl_steps>\
update etl_step set caption='${etl_step.name}' where uniquename='${etl_step.uniquename}' and tid in\
(select step_id from etl_step_relation where job_id in (select tid from etl_job where uniquename='${etl_step.etl_job}'));\
</#foreach>\
\
\
\
\
create temp table tmp_etl_step(\
tid INTEGER, \
uniquename VARCHAR(255) , \
caption VARCHAR(255) , \
systeminfo_id INTEGER not null, \
step_type INTEGER, \
step_type_uniquename VARCHAR(255), \
sortnr SMALLINT not null, \
force_continue SMALLINT,\
etl_job_id INTEGER , \
parent_step_id INTEGER , \
parent_step_uniquename varchar(255),\
parent_job_uniquename varchar(255),\
logfile varchar(255),\
custom_step smallint,\
already_exists smallint\
) \
;\
\
create temp table tmp_etl_job(\
tid INTEGER, \
uniquename VARCHAR(255) , \
caption VARCHAR(255) , \
systeminfo_id INTEGER not null,\
logfile varchar(255),\
already_exists smallint,\
custom_job smallint\
) \
;\
\
create temp table tmp_etl_job_param(\
tid SERIAL not null, \
etl_job_id INTEGER , \
uniquename VARCHAR(255) not null, \
name VARCHAR(255) , \
param_default VARCHAR(255) \
) \
;\
\
\
create temp table tmp_etl_step_property(\
tid SERIAL not null, \
etl_step_id INTEGER not null, \
prop_name VARCHAR(255) , \
prop_value text\
\
) \
;\
\
create temp table tmp_etl_step_relation(\
tid SERIAL not null, \
step_id INTEGER not null, \
parent_step_id INTEGER , \
job_id INTEGER not null, \
force_continue SMALLINT default 1 , \
step_active SMALLINT default 1, \
sortnr SMALLINT default 1,\
custom_step SMALLINT default 1\
\
) \
;\
\
--jobs with custom_job=0 get deleted in HISinOne-BI\
--therefore set to 2:\
update etl_job set custom_job=2\
where custom_job=0\
and uniquename in ('sx_select_mask','sx_insert_mask',\
'kern_konstanten_update',\
'sichten_unload',\
'sos_gewichtung_unload');\
\
\
update etl_step set custom_step=2\
where custom_step=0\
and tid in (select R.step_id from etl_step_relation R, etl_job J\
where R.job_id=J.tid\
and J.uniquename in ('sx_select_mask','sx_insert_mask',\
'kern_konstanten_update',\
'sichten_unload',\
'sos_gewichtung_unload'));\
\
update etl_step_relation set custom_step=2\
where custom_step=0\
and job_id in (select J.tid\
from etl_job J\
where J.uniquename in ('sx_select_mask','sx_insert_mask',\
'kern_konstanten_update',\
'sichten_unload',\
'sos_gewichtung_unload'));\
\
<#foreach etl_job in etl_jobs>\
\
truncate table tmp_etl_job;\
truncate table tmp_etl_step;\
truncate table tmp_etl_job_param;\
truncate table tmp_etl_step_property;\
truncate table tmp_etl_step_relation;\
\
--tids der jobs dürfen sich nicht ändern, daher \
--\
-- 1. vorh. Jobs updaten\
-- 2. neue Jobs einfügen\
-- 3. alte Jobs löschen\
\
insert into tmp_etl_job(uniquename,caption,systeminfo_id,logfile,already_exists,custom_job)\
values ('${etl_job.uniquename}',\
'${etl_job.name}',\
${etl_job.systeminfo_id},\
'${etl_job.logfile}',0,2);\
\
\
\
update tmp_etl_job set tid=J.tid,\
already_exists=1,\
caption=J.caption,\
logfile=J.logfile,\
custom_job=J.custom_job\
from etl_job J where J.uniquename=tmp_etl_job.uniquename\
and J.systeminfo_id=tmp_etl_job.systeminfo_id\
;\
\
\
--neue jobs:\
insert into etl_job(uniquename,caption,systeminfo_id,custom_job)\
select uniquename,caption,systeminfo_id,custom_job\
from tmp_etl_job\
where already_exists=0;\
--tid von neuen Jobs ermitteln:\
update tmp_etl_job set tid=(select J.tid\
from etl_job J where J.uniquename=tmp_etl_job.uniquename\
and J.systeminfo_id=tmp_etl_job.systeminfo_id)\
where already_exists=0\
;\
\
--TODO\
--obsolete Jobs: sollen bei Deinstallation des Moduls entfernt werden\
\
\
--Parameter:\
<#foreach etl_job_param in etl_job_params>\
<#if etl_job_param.etl_job==etl_job.uniquename>\
\
insert into tmp_etl_job_param(\
etl_job_id , \
uniquename, \
name , \
param_default)\
select J.tid,\
'${etl_job_param.param_name}',\
'${etl_job_param.name}',\
'${etl_job_param.param_default}'\
from tmp_etl_job J\
;\
</#if>\
</#foreach>\
\
\
\
--ETL-Schritte \
<#assign sortnr=0 />\
<#foreach etl_step in etl_steps>\
<#if etl_step.etl_job==etl_job.uniquename>\
\
<#assign sortnr=sortnr+1 />\
\
insert into tmp_etl_step(\
uniquename , \
caption , \
systeminfo_id , \
step_type_uniquename,\
sortnr, \
force_continue,\
etl_job_id , \
parent_step_uniquename,\
parent_job_uniquename,\
logfile,\
custom_step,\
already_exists\
)\
select '${etl_step.uniquename}',\
'${etl_step.name}',\
${etl_job.systeminfo_id},\
'${etl_step.type}' as step_type_uniquename,\
${sortnr}*10 as sortnr,\
0 as force_continue,\
J.tid as etl_job_id,\
<#if etl_step.parent?exists && etl_step.parent !="" >\
'${etl_step.parent}',\
<#else>\
'' as parent_step_uniquename,\
</#if>\
J.uniquename,\
'${etl_job.logfile}' as logfile,\
2,\
0\
from etl_job J\
where J.uniquename='${etl_job.uniquename}'\
and J.systeminfo_id=${etl_job.systeminfo_id};\
\
\
\
\
</#if> --Ende steps eines job\
</#foreach>\
\
--erst job-params einfügen:\
\
delete from etl_job_param\
where etl_job_id in (\
SELECT distinct \
etl_job_id\
FROM tmp_etl_job_param )\
;\
\
insert into etl_job_param\
(\
etl_job_id,\
uniquename,\
name,\
param_default\
)\
SELECT \
etl_job_id,\
uniquename,\
name,\
param_default\
FROM tmp_etl_job_param \
;\
\
--nun steps einfügen:\
\
\
update tmp_etl_step set step_type=(select T.tid from etl_step_type T\
where T.uniquename=tmp_etl_step.step_type_uniquename);\
\
--select * from tmp_etl_step\
--where step_type is null;--_uniquename from tmp_etl_step;\
\
\
--vorhandene Steps erkennen:\
\
\
update tmp_etl_step set tid=S.tid,\
already_exists=1,\
caption=S.caption,\
logfile=S.logfile,\
custom_step=S.custom_step\
from etl_step S where S.uniquename=tmp_etl_step.uniquename\
and S.systeminfo_id=tmp_etl_step.systeminfo_id\
;\
\
--neue Steps einfügen:\
insert into etl_step(\
uniquename,\
caption,\
systeminfo_id,\
step_type_id,\
logfile,\
custom_step)\
select \
uniquename,\
caption,\
systeminfo_id,\
step_type,\
logfile,\
custom_step\
FROM tmp_etl_step \
where already_exists=0\
;\
\
--tid von neuen steps ermitteln:\
update tmp_etl_step set tid=(select S.tid\
from etl_step S where S.uniquename=tmp_etl_step.uniquename\
and S.systeminfo_id=tmp_etl_step.systeminfo_id)\
where already_exists=0\
;\
\
--parent ermitteln:\
update tmp_etl_step set parent_step_id=(select S.tid\
from etl_step S where S.uniquename=tmp_etl_step.parent_step_uniquename\
and S.systeminfo_id=tmp_etl_step.systeminfo_id)\
;\
\
\
delete from etl_step_property\
where etl_step_id in (select T.tid\
FROM tmp_etl_step T )\
;\
delete from etl_step_relation\
where job_id in (select J.tid\
FROM tmp_etl_job J)\
and custom_step=2\
;\
\
\
--jetzt step-params:\
\
<#foreach etl_step_property in etl_step_properties>\
insert into tmp_etl_step_property(\
etl_step_id,\
prop_name)\
select \
T.tid as etl_step_id,\
'${etl_step_property.prop_name}'\
\
FROM tmp_etl_step T \
where uniquename ='${etl_step_property.etl_step}'\
;\
\
</#foreach>\
\
--einfügen in echte Tabelle:\
insert into etl_step_property(\
etl_step_id,\
prop_name)\
select \
T.etl_step_id,\
T.prop_name\
FROM tmp_etl_step_property T \
;\
\
--jetzt step-relation:\
insert into tmp_etl_step_relation(\
step_id,\
parent_step_id,\
job_id,\
force_continue,\
step_active,\
sortnr,\
custom_step\
)\
select \
tid,\
parent_step_id,\
etl_job_id,\
0 as force_continue,\
1 as step_active,\
sortnr,\
2\
FROM tmp_etl_step \
;\
\
insert into etl_step_relation(\
step_id,\
parent_step_id,\
job_id,\
force_continue,\
step_active,\
sortnr,\
custom_step\
)\
select \
step_id,\
parent_step_id,\
job_id,\
force_continue,\
step_active,\
sortnr,\
custom_step\
FROM tmp_etl_step_relation \
;\
</#foreach> --Ende job\
\
\
drop table tmp_etl_step;\
drop table tmp_etl_job;\
drop table tmp_etl_job_param;\
drop table tmp_etl_step_property;\
drop table tmp_etl_step_relation;\
\
\
<#foreach testfall in testfaelle>\
select 'testfall ${testfall.testcase}: ERFOLG'\
from xdummy\
where ${testfall.assertion}=(${testfall.sql})\
;\
select 'testfall ${testfall.testcase}: FEHLER bei ${testfall.testcase}'\
from xdummy\
where ${testfall.assertion}!=(${testfall.sql})\
;\
\
\
</#foreach> --Ende Testfälle\
\
<#foreach etl_step_property in etl_step_properties>\
update etl_step_property set prop_value='${etl_step_property.prop_value}' where prop_name='${etl_step_property.prop_name}' and etl_step_id=(select S.tid from etl_step S where S.uniquename='${etl_step_property.etl_step}');\
</#foreach>\
</#macro>\
\
\
<#-- Makro zum Prüfen der Definition auf mögliche Fehler -->\
<#macro etl_steps_def_check>\
<#foreach step in etl_steps>\
<#-- checking job --> \
<#assign found=false/>\
<#foreach job in etl_jobs>\
<#if job.uniquename=step.etl_job> <#assign found=true> </#if>\
</#foreach>\
<#if found=false> <#stop "DEFINITIONSFEHLER: Etl_step '"+step.uniquename+ "' verweist auf job '"+step.etl_job+"' der ist aber nicht definiert!"> </#if>\
<#-- checking step type-->\
<#switch step.type>\
<#case "LOAD">\
<#case "UNLOAD">\
<#case "DOSQL">\
<#case "DOQUERY">\
<#case "MSG"><#-- MSG wird von HisInOne noch nicht unterstuetzt-->\
<#break/>\
<#default>\
<#stop "DEFINITIONSFEHLER: Etl_step '"+step.uniquename+ "' hat unbekannten Typ '"+step.type+"'"> \
</#switch>\
</#foreach>\
\
<#-- checking step properties existing step-->\
<#foreach step_prop in etl_step_properties>\
\
<#assign found=false/>\
<#foreach step in etl_steps>\
<#if step.uniquename=step_prop.etl_step> <#assign found=true> </#if>\
</#foreach>\
<#if found=false> <#stop "DEFINITIONSFEHLER: Eine Etl_step_property '"+step_prop.prop_name+ "' verweist auf etl_step '"+step_prop.etl_step+"' der ist aber nicht definiert!"> </#if>\
</#foreach>\
</#macro>\
\
<#function etl_step_lookup_systeminfo job_uniquename>\
<#assign val=-1/>\
<#foreach job in etl_jobs>\
<#if job.uniquename=job_uniquename> <#assign val=job.systeminfo_id/></#if>\
</#foreach>\
<#return val/>\
</#function>\
\
<#macro check_etl_properties step_uniquename propname defaultvalue>\
<#if !etl_properties_contains(step_uniquename,propname)>\
<#assign new_etl_step_properties = new_etl_step_properties + [{\
"etl_step": step_uniquename,\
"prop_name": propname,\
"prop_value": defaultvalue\
}] />\
</#if>\
</#macro>\
\
\
<#function etl_properties_contains step propname>\
<#assign val=false/>\
<#foreach prop in etl_step_properties>\
<#if prop.etl_step==step&&prop.prop_name==propname> <#assign val=true/> </#if>\
</#foreach>\
<#return val>\
</#function>^Makros des ETL-Moduls^^1^

Loading…
Cancel
Save