Syntax error in Execute statement - Mailing list pgsql-sql

From Emil Rachovsky
Subject Syntax error in Execute statement
Date
Msg-id 20060306152158.81224.qmail@web54312.mail.yahoo.com
Whole thread Raw
Responses Re: [GENERAL] Syntax error in Execute statement
List pgsql-sql
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

pgsql-sql by date:

Previous
From: "A. Kretschmer"
Date:
Subject: Re: Help with "missing FROM clause" needed
Next
From: Greg Stark
Date:
Subject: Re: Help with "missing FROM clause" needed