Referring to derived column name in a RECORD

From: "David B" <postgresql(at)thegatelys(dot)com>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Referring to derived column name in a RECORD
Date: 2003-10-24 23:19:42
Message-ID: GOEGKICPFOPNLIEIHGFJEEHKCCAA.postgresql@thegatelys.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi folks,

I know I'm doing something wrong here but cannot make it work no matter how
many/few quotes I use<g>

I'm trying to reference a column in a RECORD which is not a column name but
a derived column.
Any suggestions???

Example code below to highlight the problem:

DECLARE

r_app RECORD ;

BEGIN

FOR r_app IN
SELECT to_char( created_timestamp, 'DDMMYY' ) AS "joined_on",
last_name,
first_name
FROM customer
WHERE cust_id = 123
LOOP

r_app.last_name ; -- Easy to referenece this value but...
r_app.joined_on ; -- HOW do I reference this value?...this does not work

.......

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Joe Conway 2003-10-25 02:13:07 Re: Referring to derived column name in a RECORD
Previous Message Jeff Eckermann 2003-10-24 18:43:20 Re: Regular expression problem