From cooljoint@yahoo.com Wed Jan 14 22:48:25 2004 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 0C207D1B44A for ; Wed, 14 Jan 2004 22:48:25 +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 44249-04 for ; Wed, 14 Jan 2004 18:47:55 -0400 (AST) Received: from web12107.mail.yahoo.com (web12107.mail.yahoo.com [216.136.172.27]) by svr1.postgresql.org (Postfix) with SMTP id 6B57ED1D54A for ; Wed, 14 Jan 2004 18:47:52 -0400 (AST) Message-ID: <20040114224753.1013.qmail@web12107.mail.yahoo.com> Received: from [69.72.27.2] by web12107.mail.yahoo.com via HTTP; Wed, 14 Jan 2004 14:47:53 PST Date: Wed, 14 Jan 2004 14:47:53 -0800 (PST) From: A E Subject: REPOST[GENERAL] Quoting for a Select Into - Please Help To: pgsql-sql@postgresql.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1564054890-1074120473=:669" X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=1.6 tagged_above=0.0 required=5.0 tests=HTML_20_30, HTML_TAG_EXISTS_TBODY X-Spam-Level: * X-Archive-Number: 200401/124 X-Sequence-Number: 16517 --0-1564054890-1074120473=:669 Content-Type: text/plain; charset=us-ascii Hi, Could someone help me with quoting this right? select into aliasvalue ''|| trim(arrayval[i]) ||'' from ''|| trim(realname) ||'' where ''|| trim(searchfield) ||'' like ''''%''|| trim(searchvalue) ||''%''''; The parser does not seem to want to put the value of the variables into the statement. Alex --0-1564054890-1074120473=:669 Content-Type: text/html; charset=us-ascii
Hi,
 
Could someone help me with quoting this right?
 
select into aliasvalue ''|| trim(arrayval[i]) ||''  from ''|| trim(realname) ||'' where ''|| trim(searchfield) ||'' like ''''%''|| trim(searchvalue) ||''%'''';
 
The parser does not seem to want to put the value of the variables into the statement.
 
Alex
--0-1564054890-1074120473=:669-- From sfbarbee@yahoo.com Thu Jan 15 03:17:41 2004 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id D5DFBD1B4A1 for ; Thu, 15 Jan 2004 03:17:41 +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 02679-02 for ; Wed, 14 Jan 2004 23:17:14 -0400 (AST) Received: from web41511.mail.yahoo.com (web41511.mail.yahoo.com [66.218.93.94]) by svr1.postgresql.org (Postfix) with SMTP id 66989D1B4A7 for ; Wed, 14 Jan 2004 23:17:09 -0400 (AST) Message-ID: <20040115031712.2855.qmail@web41511.mail.yahoo.com> Received: from [129.33.1.37] by web41511.mail.yahoo.com via HTTP; Wed, 14 Jan 2004 19:17:12 PST Date: Wed, 14 Jan 2004 19:17:12 -0800 (PST) From: Stuart Barbee Subject: Re: REPOST[GENERAL] Quoting for a Select Into - Please Help To: pgsql-sql@postgresql.org In-Reply-To: <20040114224753.1013.qmail@web12107.mail.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/126 X-Sequence-Number: 16519 Alex, Postgres's "select into" does not work like oracle. The "select into" for postgresql creates another table. Try this; select aliasvalue || trim(arrayval[i]) into newtablename from currenttablename where trim(searchfield) like '%' || trim(searchvalue) || '%'; Stuart --- A E wrote: > Hi, > > Could someone help me with quoting this right? > > select into aliasvalue ''|| trim(arrayval[i]) ||'' > from ''|| trim(realname) ||'' where ''|| > trim(searchfield) ||'' like ''''%''|| > trim(searchvalue) ||''%''''; > > The parser does not seem to want to put the value of > the variables into the statement. > > Alex > > __________________________________ Do you Yahoo!? Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus