From: juerg.rietmann@pup.ch
To: Michael Fork <mfork@toledolink.com>
Cc: pgsql-sql@postgresql.org
Cc: pgsql-sql-owner@postgresql.org
Subject: Re: Still don't know how to build this string ? how to concat ??
Date: Tue, 27 Mar 2001 11:20:18 +0200
Message-ID: <OFE5DBC589.2179BDB8-ONC1256A1C.0032B55B@pup.ch> (raw)
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
============================================
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: juerg.rietmann@pup.ch, mfork@toledolink.com, pgsql-sql-owner@postgresql.org
Subject: Re: Still don't know how to build this string ? how to concat ??
In-Reply-To: <OFE5DBC589.2179BDB8-ONC1256A1C.0032B55B@pup.ch>
References: <OFE5DBC589.2179BDB8-ONC1256A1C.0032B55B@pup.ch>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox