Re: PL/pgSQL Syntax Problem

From: rolf(dot)ostvik(at)axxessit(dot)no
To: pgsql-general(at)postgresql(dot)org, pgsql-interfaces(at)postgresql(dot)org, pgsql-sql(at)postgresql(dot)org
Subject: Re: PL/pgSQL Syntax Problem
Date: 2002-03-08 09:40:47
Message-ID: OFB5D7E6EF.9E3B5803-ONC1256B76.0034E703@axxessit.no
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-interfaces pgsql-sql

On 2002-03-04 21:34 Hubert Palme <hubert(dot)palme(at)web(dot)de> wrote :

>CREATE FUNCTION t_nummern(integer) -- Parameter: lfd_nr
>RETURNS text AS '
> DECLARE
> lfd_nr ALIAS FOR $1;
> erg text;
> daten record;
> BEGIN
> erg := '''';
> FOR daten IN
> SELECT * INTO daten FROM telefon WHERE t_lfd_nr = lfd_nr
Remove this ^^^^^^^^^^
so that the "FOR ... SELECT" is

FOR daten IN
SELECT * FROM telefon WHERE t_lfd_nr = lfd_nr

> LOOP
> IF erg <> '''' THEN
> erg := erg || '', '';
> END IF;
> IF daten.t_einrichtg <> '''' THEN
> erg := erg || daten.t_einrichtg || '': '';
> END IF;
> erg := erg || ''('' || daten.vorwahl || '') '' || daten.telefon_nr;
> END LOOP;
> RETURN erg;
> END;'
>LANGUAGE 'plpgsql';

regards
--
Rolf

Browse pgsql-general by date

  From Date Subject
Next Message =?ISO-8859-1?Q?Enrique_Ariz=F3n_Benito?= 2002-03-08 10:48:07 Modifying text data?
Previous Message Marc Polatschek 2002-03-08 08:58:52 Re: Problem with Subquery

Browse pgsql-interfaces by date

  From Date Subject
Next Message impala 2002-03-08 10:46:26 NEWBIE ant build.xml FAILED !!
Previous Message Nicolas Bazin 2002-03-08 07:35:18 Additional fixes to ecpg - please apply patch

Browse pgsql-sql by date

  From Date Subject
Next Message Andrew McMillan 2002-03-08 11:35:41 Re: Bad Query?? Extremely slow response
Previous Message Carlo Florendo 2002-03-08 06:57:10 URGENT! VIRUS ALERT