Skip site navigation (1) Skip section navigation (2)

Re: REPOST[GENERAL] Quoting for a Select Into - Please Help

From: Stuart Barbee <sfbarbee(at)yahoo(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: REPOST[GENERAL] Quoting for a Select Into - Please Help
Date: 2004-01-15 03:17:12
Message-ID: 20040115031712.2855.qmail@web41511.mail.yahoo.com (view raw or flat)
Thread:
Lists: pgsql-sql
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 <cooljoint(at)yahoo(dot)com> 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

In response to

pgsql-sql by date

Next:From: Tom LaneDate: 2004-01-15 03:30:09
Subject: Re: Atomic query and update of sequence generators
Previous:From: Jeffrey TennyDate: 2004-01-15 00:51:49
Subject: Atomic query and update of sequence generators

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group