X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id 2A75E30D6E3 for ; Thu, 19 Jun 2003 18:23:59 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 04231-01 for ; Thu, 19 Jun 2003 15:23:48 -0300 (ADT) Received: from anchor-post-35.mail.demon.net (anchor-post-35.mail.demon.net [194.217.242.85]) by svr1.postgresql.org (Postfix) with ESMTP id 4283330DD29 for ; Thu, 19 Jun 2003 15:23:48 -0300 (ADT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-35.mail.demon.net with esmtp (Exim 3.36 #2) id 19T44Y-0005ve-0Z; Thu, 19 Jun 2003 19:23:46 +0100 Received: from localhost (localhost.localdomain [127.0.0.1]) by mainbox.archonet.com (Postfix) with ESMTP id 57DC917A5C; Thu, 19 Jun 2003 19:23:45 +0100 (BST) Received: from client.archonet.com (client.archonet.com [192.168.1.16]) by mainbox.archonet.com (Postfix) with ESMTP id A811B17A5B; Thu, 19 Jun 2003 19:23:44 +0100 (BST) Content-Type: text/plain; charset="iso-8859-2" From: Richard Huxton Organization: Archonet Ltd To: Marcin Winkler , pgsql-sql@postgresql.org Subject: Re: is this possible in plpgsql ? Date: Thu, 19 Jun 2003 19:23:24 +0100 User-Agent: KMail/1.4.3 References: <20030619023832.2fe7ac5b.qurczak@wolomin.biz> In-Reply-To: <20030619023832.2fe7ac5b.qurczak@wolomin.biz> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200306191923.24885.dev@archonet.com> X-Virus-Scanned: by AMaViS snapshot-20020531 X-Archive-Number: 200306/229 X-Sequence-Number: 13987 On Thursday 19 Jun 2003 1:38 am, Marcin Winkler wrote: > I have 1 function in pg 7.3.2. > > txt string have 1,2,3,.. and i would like to be similar like if 3 in > (1,2,3..) then, but IF 3 in (''''||txt||'''') THEN doesn't work. > There is possible to this or not ? > txt :=3D ''''; > for i in 1 .. 10 loop > txt :=3D txt||i||'',''; > END loop; > txt :=3D txt||''0''; > IF 3 in (''''||txt||'''') THEN > raise notice ''yep''; Try something like: query:=3D''SELECT 3 in ('' || txt || '')'' EXECUTE query; Then check the result for true/false --=20 Richard Huxton