3 changed files with 74 additions and 20 deletions
@ -0,0 +1,41 @@ |
|||||||
|
|
||||||
|
DROP FUNCTION if exists sp_rpta_columns_in_layout(character varying) ; |
||||||
|
|
||||||
|
CREATE FUNCTION sp_rpta_columns_in_layout(p_column_layout_uniquename varchar(255)) |
||||||
|
RETURNS TABLE(srcfieldname varchar(255), |
||||||
|
targetfieldname varchar(255), |
||||||
|
coltype varchar(255), |
||||||
|
is_aggregate smallint, |
||||||
|
caption varchar(255), |
||||||
|
is_visible smallint, |
||||||
|
visible_width smallint, |
||||||
|
sortnr smallint, |
||||||
|
format_sql varchar(255), |
||||||
|
format_uniquename varchar(255), |
||||||
|
colfunction TEXT, |
||||||
|
column_uniquename varchar(255), |
||||||
|
description TEXT |
||||||
|
) AS $$ |
||||||
|
BEGIN |
||||||
|
RETURN QUERY SELECT C.srcfieldname, |
||||||
|
(case when string_not_null(C.targetfieldname)='' then C.srcfieldname else C.targetfieldname end) as targetfieldname, |
||||||
|
T.uniquename as coltype, |
||||||
|
C.is_aggregate, |
||||||
|
(case when string_not_null(CL.caption)='' then C.caption else CL.caption end) as caption, |
||||||
|
CL.is_visible, |
||||||
|
CL.visible_size as visible_width, |
||||||
|
CL.sortnr, |
||||||
|
F.sql_code as format_sql, |
||||||
|
F.uniquename as format_uniquename, |
||||||
|
C.col_function as colfunction, |
||||||
|
C.uniquename as column_uniquename, |
||||||
|
(case when string_not_null(CL.description)='' then C.description else CL.description end) as description |
||||||
|
FROM rpta_column_layout L, rpta_column C, rpta_column_type T,rpta_column2layout CL |
||||||
|
left outer join rpta_format_code F on (F.tid=CL.format_code_id) |
||||||
|
where L.tid=CL.layout_id |
||||||
|
and C.tid=CL.column_id |
||||||
|
and T.tid=C.column_type |
||||||
|
and L.uniquename= p_column_layout_uniquename; |
||||||
|
END; |
||||||
|
$$ LANGUAGE plpgsql; |
||||||
|
|
||||||
Loading…
Reference in new issue