Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 9FDEF6327F4 for ; Thu, 22 Oct 2009 08:50:13 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 37714-07 for ; Thu, 22 Oct 2009 11:49:55 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from cirrus.hsolutions.ch (cirrus.hsolutions.ch [212.203.66.103]) by mail.postgresql.org (Postfix) with ESMTP id 88BAB6321BE for ; Thu, 22 Oct 2009 08:50:02 -0300 (ADT) Received: from [192.168.32.120] (unknown [78.234.64.238]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by cirrus.hsolutions.ch (Postfix) with ESMTPSA id 46580880003 for ; Thu, 22 Oct 2009 13:54:54 +0200 (CEST) Message-ID: <4AE046E4.8010205@hsolutions.ch> Date: Thu, 22 Oct 2009 13:49:56 +0200 From: Denis BUCHER Organization: Horus Digital Solutions =?ISO-8859-1?Q?S=E0rl?= User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Problem with return type of function ??? (corrected) Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.506 tagged_above=-10 required=5 tests=AWL=0.093, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200910/97 X-Sequence-Number: 33296 Hello, (CORRECTED VERSION OF MY PREVIOUS EMAIL) 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 "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 -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql