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 0E71D8B9B2E for ; Wed, 9 Feb 2005 14:13:34 +0000 (GMT) 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 99575-06 for ; Wed, 9 Feb 2005 14:13:15 +0000 (GMT) Received: from boutiquenumerique.com (boutiquenumerique.com [82.67.9.10]) by svr1.postgresql.org (Postfix) with ESMTP id 568B28B9B45 for ; Wed, 9 Feb 2005 14:13:17 +0000 (GMT) Received: (qmail 16712 invoked from network); 9 Feb 2005 15:13:44 +0100 Received: from unknown (HELO musicbox) (boutiquenumerique-lists@192.168.0.2) by boutiquenumerique.com with SMTP; 9 Feb 2005 15:13:44 +0100 To: NosyMan , pgsql-sql@postgresql.org Subject: Re: How to iterate through arrays? References: <200502091559.08997.nosyman@gmail.com> Message-ID: From: PFC Organization: =?iso-8859-15?Q?La_Boutique_Num=E9rique?= Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-15 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Date: Wed, 09 Feb 2005 15:16:33 +0100 In-Reply-To: <200502091559.08997.nosyman@gmail.com> User-Agent: Opera M2/7.54u1 (Linux, build 892) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.004 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200502/120 X-Sequence-Number: 20231 - use TEXT instead of CHAR (what is CHAR without (n) ?) - inintialize your array with '{}' because it is created as NULL if you just declare it without setting it to an empty array. > Hi there, > > I'm trying to iterate through arrays in PL/PGSQL: > .... > DECLARE > update_query CHAR; > update_query_params CHAR ARRAY[6]; > BEGIN > update_query_params[1]:='some text'; > > RAISE NOTICE 'Testing element %', update_query_params[1]; > END > ..... > > > It does not 'compile'... :-(. Can you tell me what is the problem? > > Thanks, > Nosy > > ---------------------------(end of broadcast)--------------------------- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) >