From: Wilton <wilton.wonrath@microwork.inf.br>
To: pgsql-sql@postgresql.org
Subject: Function Doubt
Date: Thu, 27 Jan 2005 14:32:10 -0300
Message-ID: <41F9259A.2080402@microwork.inf.br> (raw)
Inside a function of trigger type, i have:
Declare
qCampos record;
StrCampo string;
StrInsert string;
Begin
StrCampo = '''';
StrInsert = '''';
For qCampos in select pga.attname from pg_class pgc, pg_attribute pga
where pgc.relname = '''' || tg_relname || '''' and
pgc.oid = pga.attrelid and pga.attnum > 0 and
attisdropped <> ''t'' Loop
StrCampo = ''new.'' || qCampos.attname;
StrInsert = StrInsert || virgula || StrCampo || '' - '';
End Loop;
Return new;
End;
What i need to do for the variable StrCampo returns to me "SP", "RJ", i
mean, return a value inserted into the field.
I do not want to use static command new.campo1, new.campo2....
Thanks,
Wilton Ruffato Wonrath
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.7.6 - Release Date: 27/1/2005
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: wilton.wonrath@microwork.inf.br
Subject: Re: Function Doubt
In-Reply-To: <41F9259A.2080402@microwork.inf.br>
* 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