X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 3F4CF3A5F1D for ; Thu, 27 Jan 2005 16:34:05 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 81800-04 for ; Thu, 27 Jan 2005 16:34:00 +0000 (GMT) Received: from hm03.locaweb.com.br (hm03.locaweb.com.br [200.234.203.3]) by svr1.postgresql.org (Postfix) with SMTP id 96BE13A5F02 for ; Thu, 27 Jan 2005 16:33:58 +0000 (GMT) Received: (qmail 3565 invoked by uid 0); 27 Jan 2005 16:33:52 -0000 Received: from unknown (200.246.179.93) by hm03.locaweb.com.br with QMTP; 27 Jan 2005 16:33:52 -0000 Received: (qmail 19382 invoked from network); 27 Jan 2005 16:33:51 -0000 Received: from unknown (HELO ?192.168.1.86?) (wilton.wonrath@microwork.inf.br@200.246.46.224) by hm28.locaweb.com.br with SMTP; 27 Jan 2005 16:33:52 -0000 Received: from 127.0.0.1 (AVG SMTP 7.0.300 [265.7.6]); Thu, 27 Jan 2005 14:32:22 -0300 Message-ID: <41F9259A.2080402@microwork.inf.br> Date: Thu, 27 Jan 2005 14:32:10 -0300 From: Wilton User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: pt-br, pt To: pgsql-sql@postgresql.org Subject: Function Doubt Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=ISO-8859-1; format=flowed X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.035 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200501/296 X-Sequence-Number: 20084 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