Syntax error in Execute statement

Поиск
Список
Период
Сортировка
От Emil Rachovsky
Тема Syntax error in Execute statement
Дата
Msg-id 20060306152158.81224.qmail@web54312.mail.yahoo.com
обсуждение исходный текст
Ответы Re: [GENERAL] Syntax error in Execute statement  (Michael Fuhr <mike@fuhr.org>)
Список 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 по дате отправления:

Предыдущее
От: "A. Kretschmer"
Дата:
Сообщение: Re: Help with "missing FROM clause" needed
Следующее
От: Greg Stark
Дата:
Сообщение: Re: Help with "missing FROM clause" needed