From: Denis BUCHER <dbucherml@hsolutions.ch>
To: pgsql-sql@postgresql.org
Subject: Problem with return type of function ???
Date: Thu, 22 Oct 2009 13:31:59 +0200
Message-ID: <4AE042AF.9020507@hsolutions.ch> (raw)
Hello,
I have a strange problem, because it worked in a fonction for a table,
and now I created the same (?) function for another table and it doesn't
work...
The function is accepted but at runtime I get :
ERREUR: wrong record type supplied in RETURN NEXT
CONTEXTE : PL/pgSQL function "hds_bw_find_sn_live" line 26 at return next
Does someone maybe knows what it could be ?
This is (a part of) my function :
> CREATE OR REPLACE FUNCTION rma.find_sn_live (varchar(30)) RETURNS SETOF rma.serial_number
> AS $_$
> DECLARE
> serialnumber ALIAS FOR $1;
> row RECORD;
> BEGIN
>
> FOR row IN
> SELECT * FROM rma.serial_number WHERE sn=serialnumber
> LOOP
> RETURN NEXT row;
> END LOOP;
>
> END;
> $_$
> LANGUAGE plpgsql STRICT;
Thanks a lot for any help !
Denis
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 using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: dbucherml@hsolutions.ch
Subject: Re: Problem with return type of function ???
In-Reply-To: <4AE042AF.9020507@hsolutions.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