pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedReferring to derived column name in a RECORD
2+ messages / 2 participants
[nested] [flat]
* Referring to derived column name in a RECORD
@ 2003-10-24 23:19 David B <postgresql@thegatelys.com>
0 siblings, 1 reply; 2+ messages in thread
From: David B @ 2003-10-24 23:19 UTC (permalink / raw)
To: 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
.......
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Referring to derived column name in a RECORD
@ 2003-10-25 02:13 Joe Conway <mail@joeconway.com>
parent: David B <postgresql@thegatelys.com>
0 siblings, 0 replies; 2+ messages in thread
From: Joe Conway @ 2003-10-25 02:13 UTC (permalink / raw)
To: David B <postgresql@thegatelys.com>; +Cc: pgsql-sql
David B wrote:
> SELECT to_char( created_timestamp, 'DDMMYY' ) AS "joined_on",
<snip>
> r_app.joined_on ; -- HOW do I reference this value?...this does not work
Try either making that first line:
... AS joined_on,
(i.e. without the double quotes) or make the second one:
r_app."joined_on";
(i.e. with double quotes)
HTH,
Joe
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2003-10-25 02:13 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-10-24 23:19 Referring to derived column name in a RECORD David B <postgresql@thegatelys.com>
2003-10-25 02:13 ` Joe Conway <mail@joeconway.com>
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