Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 715EF133798E for ; Fri, 18 Feb 2011 07:59:48 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 79116-04 for ; Fri, 18 Feb 2011 11:59:42 +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 E93211336FA7 for ; Fri, 18 Feb 2011 07:59:40 -0400 (AST) Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.69) (envelope-from ) id 1PqOzt-0000AD-4q for pgsql-sql@postgresql.org; Fri, 18 Feb 2011 03:59:41 -0800 Date: Fri, 18 Feb 2011 03:59:41 -0800 (PST) From: arthur_info To: pgsql-sql@postgresql.org Message-ID: <1298030381145-3390966.post@n5.nabble.com> In-Reply-To: <1298029600705-3390948.post@n5.nabble.com> References: <1297872976915-3387932.post@n5.nabble.com> <1298029600705-3390948.post@n5.nabble.com> Subject: Re: 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/101 X-Sequence-Number: 35177 Wow, I don't know if I exposed the problem in the right way, but I'm not achieving the solution with information_schema... Let me show the function: CREATE OR REPLACE FUNCTION fc_teste_tce2(codigo_aluno integer) RETURNS character varying AS $BODY$ DECLARE reg record; reg2 record; msg character varying; i integer; BEGIN msg := ''; i := 0; for reg in SELECT * FROM estagio.vw_aluno_tce where aluno::integer = codigo_aluno loop for reg2 in select column_name from information_schema.columns where table_catalog = 'seduc' and table_schema = 'estagio' and table_name = 'vw_aluno_tce' loop if reg.reg2.column_name = '' then --> how can I do this to check if there's no value for the field? i := 1; end if; end loop; end loop; if (i = 1) then return 'Problems...'; else return 'ok'; end if; END; $BODY$ LANGUAGE plpgsql VOLATILE COST 100; Thanks a lot! -- View this message in context: http://postgresql.1045698.n5.nabble.com/Retrieve-the-column-values-of-a-record-without-knowing-the-names-tp3387932p3390966.html Sent from the PostgreSQL - sql mailing list archive at Nabble.com.