Received: from shiva.jussieu.fr (shiva.jussieu.fr [134.157.0.129]) by hub.org (8.9.2/8.9.1) with ESMTP id KAA86545 for ; Fri, 19 Feb 1999 10:08:40 -0500 (EST) (envelope-from basier@ipgp.jussieu.fr) Received: from toutatis.ipgp.jussieu.fr (root@toutatis.ipgp.jussieu.fr [134.157.26.27]) by shiva.jussieu.fr (8.9.1a/jtpda-5.3.1) with ESMTP id QAA19043 for ; Fri, 19 Feb 1999 16:08:30 +0100 (CET) Received: from sismo1.ipgp.jussieu.fr (sismo1.ipgp.jussieu.fr [134.157.27.131]) by toutatis.ipgp.jussieu.fr (8.9.2/jtpda-5.3.1) with ESMTP id QAA15195 for ; Fri, 19 Feb 1999 16:06:19 +0100 (MET) Received: from ipgp.jussieu.fr (geosp5 [134.157.27.5]) by sismo1.ipgp.jussieu.fr (8.8.5/jtpda-5.2) with ESMTP id QAA14817 for ; Fri, 19 Feb 1999 16:08:27 +0100 (MET) Sender: basier@ipgp.jussieu.fr Message-ID: <36CD7E6A.55E39A5E@ipgp.jussieu.fr> Date: Fri, 19 Feb 1999 16:08:28 +0100 From: Eric BASIER X-Mailer: Mozilla 4.02 [en] (X11; I; SunOS 5.6 sun4m) MIME-Version: 1.0 To: pgsql-sql Subject: problem with function in plpgsql Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Transfer-Encoding: 7bit Hello; I have a table pz like this : Table = pz +----------------------------------+----------------------------------+-------+ | Field | Type | Length| +----------------------------------+----------------------------------+-------+ | cle | int4 not null | 4 | | titre | varchar() not null | 25 | | typ | char() not null | 1 | | in_unit | int4 not null | 4 | | out_unit | int4 not null | 4 | | pcterr | float8 | 8 | | a0 | float8 | 8 | | af | float8 | 8 | | desctype | varchar() | 4 | | description | int8 | 8 | +----------------------------------+----------------------------------+-------+ I have to create a function who take me one row like that create function test_exist_pz (text,int4,int4,float,float) returns text as ' declare pzrec pz%RowType; begin select * into pzrec from pz where typ = $1 and in_unit = $2 and out_unit = $3 and A0 = $4 and AF = $5; if not found then pzrec.cle = -1; end if; return pzrec; end; ' language 'plpgsql'; CREATE When I try to work with the function it doesn't I have this result : seed=> select test_exist_pz('a',1,1,1.1,1.2); ERROR: attribute 'pzrec' not found I am not very familiar with plpgsql and so if there is somebody who can help me or if thre is somebody who can say where can I find documentation about plpgsql it is very well Thanks -- Basier Eric e-mail : basier@ipgp.jussieu.fr http://geoscope.ipgp.jussieu.fr IPGP Observatoires Sismologie-Volcanologie 4,Place Jussieu 75005 Paris Tour 24-14 4eme Etage Tel 01 44 27 38 96