Skip site navigation (1) Skip section navigation (2)

Re: PL/pgSQL Syntax Problem

From: hubert(dot)palme(at)web(dot)de (Hubert Palme)
To: Jan Wieck <janwieck(at)yahoo(dot)com>
Cc: Hubert Palme <hubert(dot)palme(at)web(dot)de>, 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-05 20:33:44
Message-ID: 15493.11176.438179.736883@palme-pc.urz.Uni-Wuppertal.DE (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-interfacespgsql-sql
Thanks to all who answered -- you solved my problemn :-)

Hubert

 > Hubert Palme wrote:
 >> Hi,
 >> 
 >> this function:
 >> 
 >> 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
 >> 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';
 >> 
 >> causes the following error:
 >> 
 >> mitglieder=> select t_nummern(330);
 >> ERROR:  query "SELECT  * INTO daten FROM telefon WHERE t_lfd_nr =  $1 "
 >> isn't a
 >> SELECT
 >> mitglieder=>
 >> 
 >> Why isn't this a SELECT??

-- 
Hubert Palme                           Am Walde 1
                                 42119 Wuppertal
<hubert(dot)palme(at)web(dot)de>

In response to

pgsql-sql by date

Next:From: Kovacs ZoltanDate: 2002-03-05 22:49:55
Subject: Re: getting pid of backend
Previous:From: Josh BerkusDate: 2002-03-05 18:21:58
Subject: Re: getting pid of backend

pgsql-interfaces by date

Next:From: Jim ParkerDate: 2002-03-05 23:08:22
Subject: Linking ECPG files to a C program
Previous:From: Tom LaneDate: 2002-03-05 16:03:57
Subject: Re: Error passing parameter to functions

pgsql-general by date

Next:From: gelinasDate: 2002-03-05 22:08:26
Subject: Index not used with user
Previous:From: Ulrich WisserDate: 2002-03-05 20:22:05
Subject: Re: vacuum statistics

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group