pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Emil Rachovsky <zsevgymko@yahoo.com>
To: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Cc: pgsql-sql@postgresql.org <pgsql-sql@postgresql.org>
Subject: Syntax error in Execute statement
Date: Mon, 6 Mar 2006 07:21:58 -0800 (PST)
Message-ID: <20060306152158.81224.qmail@web54312.mail.yahoo.com> (raw)

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 



view thread (2+ messages)  latest in thread

Message-ID: <20060306152158.81224.qmail@web54312.mail.yahoo.com>
Permalink:  ../20060306152158.81224.qmail@web54312.mail.yahoo.com/
Also on:    postgresql.org/message-id/20060306152158.81224.qmail@web54312.mail.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: zsevgymko@yahoo.com, pgsql-general@postgresql.org
  Subject: Re: Syntax error in Execute statement
  In-Reply-To: <20060306152158.81224.qmail@web54312.mail.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox