Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id CFAAF1337B6E for ; Wed, 16 Feb 2011 12:18:27 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 53577-08 for ; Wed, 16 Feb 2011 16:18:20 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sam.nabble.com (sam.nabble.com [216.139.236.26]) by mail.postgresql.org (Postfix) with ESMTP id 752EB1337B34 for ; Wed, 16 Feb 2011 12:18:20 -0400 (AST) Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.69) (envelope-from ) id 1Ppk56-0003WH-1F for pgsql-sql@postgresql.org; Wed, 16 Feb 2011 08:18:20 -0800 Date: Wed, 16 Feb 2011 08:18:19 -0800 (PST) From: arthur_info To: pgsql-sql@postgresql.org Message-ID: <1297873099984-3387935.post@n5.nabble.com> Subject: Retrieve the column values of a record without knowing the names MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.767 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, T_TO_NO_BRKTS_FREEMAIL=0.01, URI_HEX=1.122 X-Spam-Level: X-Archive-Number: 201102/82 X-Sequence-Number: 35158 Hello, I've got the following function and I want to access the fields values of my record by index. The problem is that my select is retrieving each record line with all values and not each one of each row on my view... How can I solve this problem? Thanks in advance. CREATE FUNCTION fc_teste_tce(aluno integer) RETURNS character varying AS $BODY$ DECLARE reg record; BEGIN for reg in execute 'SELECT ARRAY (SELECT vw_teste_tce FROM estagio.vw_teste_tce where aluno = ''3043'' LIMIT 20) AS campos' loop for j in 1..array_upper(reg.campos,1) loop raise notice 'Field Value: %',reg.campos[j]; end loop; end loop; return 'ok'; END; $BODY$ LANGUAGE plpgsql VOLATILE; -- View this message in context: http://postgresql.1045698.n5.nabble.com/Retrieve-the-column-values-of-a-record-without-knowing-the-names-tp3387935p3387935.html Sent from the PostgreSQL - sql mailing list archive at Nabble.com.