From: arthur_info <arthur_info@yahoo.com.br>
To: pgsql-sql@postgresql.org
Subject: Re: Retrieve the column values of a record without knowing the names
Date: Fri, 18 Feb 2011 03:59:41 -0800 (PST)
Message-ID: <1298030381145-3390966.post@n5.nabble.com> (raw)
In-Reply-To: <1298029600705-3390948.post@n5.nabble.com>
References: <1297872976915-3387932.post@n5.nabble.com>
<AANLkTikuw_5gs190=PFqtY+XyH6=L_ZKmQXcB5tjWbFt@mail.gmail.com>
<1298029600705-3390948.post@n5.nabble.com>
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-n...
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.
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: arthur_info@yahoo.com.br
Subject: Re: Retrieve the column values of a record without knowing the names
In-Reply-To: <1298030381145-3390966.post@n5.nabble.com>
* 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