Search Postgresql Archives

Syntax error in Execute statement

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I created a function "coalescec" which behaves the
same as coalesce, but uses an integer and a string.
Now I'm getting an error in the folowing statements : 
  

query := 'select "UID" from S_Users_To_Connection
where ConnID = ' || coalescec(conn_id,'null');
execute query into nUID;

ERROR:  syntax error at or near "$2" at character 20
QUERY:  SELECT   $1  into  $2 

I have put UID in quotes because it seems to be a
keyword. 

Here is the table script: 

create TEMP table S_Users_To_Connection(
 UID integer NOT NULL
,ConnID integer NOT NULL
,LoginID integer NOT NULL
);

Any suggestions ?

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux