X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id B2A13329D30 for ; Sun, 26 Sep 2004 17:15:40 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 24299-09 for ; Sun, 26 Sep 2004 16:15:36 +0000 (GMT) Received: from amitabha.axelero.hu (fe04.axelero.hu [195.228.240.92]) by svr1.postgresql.org (Postfix) with ESMTP id 5BD34329E32 for ; Sun, 26 Sep 2004 17:15:35 +0100 (BST) Received: from amitabha (localhost-02 [127.0.2.1]) by amitabha.axelero.hu (8.12.11/8.12.11) with SMTP id i8QGFXhU074977 for ; Sun, 26 Sep 2004 18:15:33 +0200 (CEST) Received: from fe04.axelero.hu [127.0.2.1] via SMTP gateway by amitabha [195.228.240.92]; id A024D54298A at Sun, 26 Sep 2004 18:15:33 +0200 Received: from freestart.hu (45.34-182-adsl-pool.axelero.hu [81.182.34.45]) by fe04.axelero.hu (8.12.11/8.12.11) with ESMTP id i8QGFWBM074937 for ; Sun, 26 Sep 2004 18:15:32 +0200 (CEST) Message-ID: <4156EB3D.3070805@freestart.hu> Date: Sun, 26 Sep 2004 18:15:57 +0200 From: =?ISO-8859-1?Q?Sz=E1lka_Tam=E1s?= User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en, hu MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: plpgsql - accessing fields of record type Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200409/220 X-Sequence-Number: 19066 Hi! I'd like to ask whether it is possible to access fields of record type variable in plpgsql in the following way: I have a table with field named "XY_1", "XY_2", ... "XY_255". I want to access the values in the table from a plpgsql function somehow in a loop with the iterative variable. Can I address the appropriate ''XY_'' || loopvariable field with the help of the loop variable? If I can, what is the syntax of this? Sorry, I've read through the documentation, but haven't find any solution. I have thought of an alternative solution: can plpgsql convert a record type into array? (Then I could address the field value with the nth element of the array) Thanks for your help tomasz