X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 47CC7D1B515 for ; Fri, 24 Oct 2003 23:19:47 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 91193-03 for ; Fri, 24 Oct 2003 20:19:19 -0300 (ADT) Received: from loki.worldwidehosting.net (unknown [206.104.238.76]) by svr1.postgresql.org (Postfix) with SMTP id E6770D1B535 for ; Fri, 24 Oct 2003 20:19:00 -0300 (ADT) Received: (qmail 10154 invoked from network); 24 Oct 2003 23:18:48 -0000 Received: from adsl-67-123-247-142.dsl.pltn13.pacbell.net (HELO DellLaptopDG) (67.123.247.142) by 9s.com with SMTP; 24 Oct 2003 23:18:48 -0000 From: "David B" To: Subject: Referring to derived column name in a RECORD Date: Fri, 24 Oct 2003 16:19:42 -0700 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Importance: Normal X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/330 X-Sequence-Number: 15730 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 .......