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.
 
 
 
 
 

122 lines
3.4 KiB

48150^Spalte anlegen^--Autor: D. Quathamer\
--Datum: 15.3.2024\
--freemarker template\
\
create temp table tmp_rpta_column (\
ord smallint,\
tid INTEGER , \
uniquename varchar(255),\
caption varchar(255),\
srcfieldname varchar(255),\
column_type integer,\
column_type_str varchar(255),\
column_type_uniquename varchar(255),\
col_function text,\
is_aggregate smallint,\
resultset_id integer,\
resultset_str varchar(255),\
systeminfo_str varchar(255),\
custom integer ,\
description text,\
targetfieldname varchar(255),\
nextedit varchar(255)\
);\
\
begin work;\
\
insert into tmp_rpta_column (--ord,\
-- tid,\
-- uniquename,\
-- caption,\
-- srcfieldname,\
column_type,\
column_type_str,\
column_type_uniquename,\
-- col_function,\
-- is_aggregate,\
resultset_id\
-- custom,\
-- description,\
-- targetfieldname,\
-- nextedit\
) \
select \
T.tid,\
T.caption as column_type_str,\
T.uniquename as column_type_uniquename,\
<<Virtuelle Tabelle>> as resultset_id\
FROM rpta_column_type T \
where T.tid=<<Spaltentyp>> \
;\
\
update tmp_rpta_column set resultset_str=R.caption\
from rpta_resultset R\
where R.tid=tmp_rpta_column.resultset_id;\
\
/*update tmp_rpta_column set srcfieldname=F.name,\
is_aggregate=F.is_sum,\
uniquename=F.name,\
caption=F.caption\
from sx_fields F, rpta_resultset R\
where F.table_name=R.uniquename\
and R.tid=tmp_rpta_column.resultset_id\
and F.name=<<Quellfeld>>\
and tmp_rpta_column.column_type_uniquename='physicalColumn'; */\
\
\
/* update tmp_rpta_column set uniquename=<<Schlüssel>>; */\
/* update tmp_rpta_column set caption=<<Name>>;*/\
\
update tmp_rpta_column set uniquename='Created ' || timestamp_str(now())\
where uniquename is null;\
update tmp_rpta_column set caption='Created ' || timestamp_str(now())\
where caption is null;\
\
\
select sp_update_sequence('rpta_column');\
\
insert into rpta_column( uniquename,\
caption,\
srcfieldname,\
column_type,\
col_function,\
is_aggregate,\
resultset_id,\
custom,\
description,\
targetfieldname)\
select uniquename,\
caption,\
srcfieldname,\
column_type,\
col_function,\
is_aggregate,\
resultset_id,\
custom,\
description,\
targetfieldname\
from tmp_rpta_column;\
\
update tmp_rpta_column set tid=currval('rpta_column_tid_seq');\
\
\
commit;\
\
select 'Ergebnis' as s1, \
' Eintrag angelegt:' || coalesce(C.caption,'Unbenannt') || ' (' || coalesce(C.uniquename,'TID: ' || C.tid::varchar) || ') [' || C.column_type_str || ']' as ergebnis2,\
'../edit/rpta/rpta_column_edit.jsp|tid=' || C.tid as nextedit\
from tmp_rpta_column C\
;^XIL List\
drop_and_delete movable_columns sizable_columns horizontal_scrolling\
white_space_color=COLOR_WHITE fixed_columns=2\
min_heading_height=35\
Column CID=0 heading_text="Ergebnis" center_heading\
row_selectable col_selectable heading_platform readonly\
width=50 text_size=100\
Column CID=0 heading_text="Spalte" center_heading\
row_selectable col_selectable heading_platform readonly\
width=50 text_size=100\
Column CID=1 heading_text="Bearbeiten" center_heading\
row_selectable col_selectable heading_platform readonly\
width=5 text_size=200\
@@@^^^Spaltendefinitionen anlegen^drop table tmp_rpta_column;^^1^440^360^0^1^ ^