Re: Referring to derived column name in a RECORD
Re: Referring to derived column name in a RECORD
От:
Joe Conway <mail@joeconway.com>
Дата:
David B wrote: > SELECT to_char( created_timestamp, 'DDMMYY' ) AS "joined_on", > 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
Referring to derived column name in a RECORD
От:
"David B" <postgresql@thegatelys.com>
Дата:
Hi folks, I know I'm doing something wrong here but cannot make it work no matter how many/few quotes I use 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 .......