Hello
I'm closer to a solution. The query results is :
Result:
01 1440
02 1460
03 1398
The values (1440, ...) are the last entries of z_u_umfang for each z_u_typ.
This is correct since in the function the list:= ... is overwritten until
the last record is read.
When I try to concat the list in the manner of list := list ||
text(rec.z_u_umfang); the zustring is empty !
Thanks for any help ... jr
Query :
select distinct z_u_typ, buildString(z_u_typ) as zustring from
zylinder_umfang
Function:
CREATE FUNCTION buildString(bpchar) RETURNS text AS '
DECLARE
list text;
rec record;
BEGIN
FOR rec IN SELECT z_u_umfang FROM zylinder_umfang WHERE z_u_typ
= $1;
list := text(rec.z_u_umfang);
END LOOP;
RETURN list;
END;
' LANGUAGE 'plpgsql';
============================================
PFISTER + PARTNER, SYSTEM - ENGINEERING AG
Juerg Rietmann
Grundstrasse 22a
6343 Rotkreuz
Switzerland
phone: +4141 790 4040
fax: +4141 790 2545
mobile: +4179 211 0315
============================================
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?
http://www.postgresql.org/search.mpl