X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id E4EE29F9CEE for ; Tue, 16 May 2006 01:05:34 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 44135-04 for ; Tue, 16 May 2006 01:05:27 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from floppy.pyrenet.fr (floppy.pyrenet.fr [194.116.145.2]) by postgresql.org (Postfix) with ESMTP id 6E4759F9430 for ; Tue, 16 May 2006 01:05:27 -0300 (ADT) Received: by floppy.pyrenet.fr (Postfix, from userid 106) id BC47731923; Tue, 16 May 2006 06:05:26 +0200 (MET DST) From: lingyu.tseng@gmail.com X-Newsgroups: pgsql.sql Subject: how referencing %rowtype variables without column names Date: 15 May 2006 21:05:20 -0700 Organization: http://groups.google.com Lines: 17 Message-ID: <1147752320.462523.254730@j33g2000cwa.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Complaints-To: groups-abuse@google.com User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322),gzip(gfe),gzip(gfe) X-HTTP-Via: 1.0 PC-ISA03 Complaints-To: groups-abuse@google.com Injection-Info: j33g2000cwa.googlegroups.com; posting-host=210.241.201.23; posting-account=tXYdWQwAAADtCzBiZXWG8vQK-kMlI0zR To: pgsql-sql@postgresql.org X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/127 X-Sequence-Number: 25158 I wrote a trigger and use %rowtype , the problue is I need to put the column name in a variable like Declare columnname VARCHAR(20); NOTIFYRULE NOTIFY_RULE%ROWTYPE begin columnname='TYPE' /* ONE OF NOTIFY_RULE column*/ SELECT * INTO NOTIFYRULE FROM NOTIFY_RULE WHERE STATUS=:OLD.STATUS; end; how can i use this columnname to get the column value form NOTIFYRULE without use "NOTIFYRULE.TYPE"