From: juerg.rietmann@pup.ch
To: pgsql-admin@postgresql.org
Subject: problem with view/function after upgrade to 7.2
Date: Tue, 12 Feb 2002 08:52:01 +0100
Message-ID: <OF4B75D79A.D0042C31-ONC1256B5E.002ACC54@pup.ch> (raw)
Hello there
After upgrading from 7.0.3 to 7.2 almost everything is up and running !
Except the following function/view is not working. I get an error, saying :
Missing LOOP at end of SQL expression
What has changed here ? Thanks for any help !!
Regards ... jr
CREATE FUNCTION buildString(bpchar)
RETURNS text AS '
DECLARE
list text;
rec record;
BEGIN
list := '''';
FOR rec IN SELECT z_u_umfang FROM zylinder_umfang WHERE z_u_typ = $1;
list := list || text(rec.z_u_umfang) || '','';
END LOOP;
RETURN list;
END;'
LANGUAGE 'plpgsql';
CREATE VIEW "viewrzumfang" AS
SELECT rotation.r_code, rotation.r_name, rotation.r_z_typ,
(SELECT zylinder_typen.z_laenge FROM zylinder_typen WHERE
(zylinder_typen.z_typ = rotation.r_z_typ)) AS r_z_laenge,
(SELECT zylinder_typen.z_blaenge FROM zylinder_typen WHERE
(zylinder_typen.z_typ = rotation.r_z_typ)) AS r_z_blaenge,
(SELECT zylinder_typen.z_alaenge_l FROM zylinder_typen WHERE
(zylinder_typen.z_typ = rotation.r_z_typ)) AS r_z_alaenge_l,
(SELECT zylinder_typen.z_alaenge_r FROM zylinder_typen WHERE
(zylinder_typen.z_typ = rotation.r_z_typ)) AS r_z_alaenge_r,
(SELECT rtrim(buildstring(rotation.r_z_typ), ','::text) AS rtrim) AS
r_z_umfang FROM rotation;
__________________________________________________
PFISTER + PARTNER, SYSTEM - ENGINEERING AG
Juerg Rietmann
Grundstrasse 22a
6343 Rotkreuz
Switzerland
internet : www.pup.ch
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-admin@postgresql.org
Cc: juerg.rietmann@pup.ch
Subject: Re: problem with view/function after upgrade to 7.2
In-Reply-To: <OF4B75D79A.D0042C31-ONC1256B5E.002ACC54@pup.ch>
References: <OF4B75D79A.D0042C31-ONC1256B5E.002ACC54@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