X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id C198F9FB22E for ; Tue, 29 Aug 2006 09:33:54 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 80205-05 for ; Tue, 29 Aug 2006 09:33:44 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from nz-out-0102.google.com (nz-out-0102.google.com [64.233.162.204]) by postgresql.org (Postfix) with ESMTP id 4EF3A9FB227 for ; Tue, 29 Aug 2006 09:33:44 -0300 (ADT) Received: by nz-out-0102.google.com with SMTP id 40so1303271nzk for ; Tue, 29 Aug 2006 05:33:42 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=jgpBOyeLa70JxIYBLID8SXTAP9N73Emq3KqZgbyWL6qFMBSvnEaAxdlLD7GW/nK9jzHSI4l84kP/HczTjDJzcQjWzx6ayExKJW6zDW4nLP/AoAxKEEKy6frSbZuI2oooVSnO4La7Gws/WpodXBRSmJqrc9B5HheGiX4h7fzAT3E= Received: by 10.35.111.14 with SMTP id o14mr14808203pym; Tue, 29 Aug 2006 05:33:42 -0700 (PDT) Received: by 10.35.54.5 with HTTP; Tue, 29 Aug 2006 05:33:42 -0700 (PDT) Message-ID: Date: Tue, 29 Aug 2006 07:33:42 -0500 From: "Jaime Casanova" To: "Manso Gomez, Ramon" Subject: Re: dinamic sql Cc: pgsql-sql@postgresql.org In-Reply-To: <12B09E52EF3AEF41AEF3D205BD4DF4651FAE8D@MADARRMAIL3.indra.es> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <12B09E52EF3AEF41AEF3D205BD4DF4651FAE8D@MADARRMAIL3.indra.es> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.193 tagged_above=0 required=5 tests=AWL, SPF_PASS X-Spam-Level: X-Archive-Number: 200608/228 X-Sequence-Number: 26186 On 8/29/06, Manso Gomez, Ramon wrote: > > if(user_Input = 'a') > l_query := l_query||a_from_clause ||'where ename in '||user_Input > else > if(user_Input = 'b') > l_query := l_query||b_from_clause||'where ename in '||user_Input > > OPEN csr FOR l_query; > l_query := l_query || a_from_clause || 'where ename in (' || quote_literal(user_input) || ')' -- regards, Jaime Casanova "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs and the universe trying to produce bigger and better idiots. So far, the universe is winning." Richard Cook