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

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

From
A E
Date:
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

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

From
Stuart Barbee
Date:
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@yahoo.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