pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: lingyu.tseng@gmail.com
To: pgsql-sql@postgresql.org
Subject: how referencing %rowtype variables without column names
Date: 15 May 2006 21:05:20 -0700
Message-ID: <1147752320.462523.254730@j33g2000cwa.googlegroups.com> (raw)

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"




Message-ID: <1147752320.462523.254730@j33g2000cwa.googlegroups.com>
Permalink:  ../1147752320.462523.254730@j33g2000cwa.googlegroups.com/
Also on:    postgresql.org/message-id/1147752320.462523.254730@j33g2000cwa.googlegroups.com

 · 

reply

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: lingyu.tseng@gmail.com
  Subject: Re: how referencing %rowtype variables without column names
  In-Reply-To: <1147752320.462523.254730@j33g2000cwa.googlegroups.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