X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id B0F069DCCB3 for ; Mon, 6 Mar 2006 11:21:57 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 37332-06 for ; Mon, 6 Mar 2006 11:22:00 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from web54312.mail.yahoo.com (web54312.mail.yahoo.com [206.190.49.122]) by postgresql.org (Postfix) with SMTP id E7EA49DCC86 for ; Mon, 6 Mar 2006 11:21:53 -0400 (AST) Received: (qmail 81226 invoked by uid 60001); 6 Mar 2006 15:21:58 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding; b=ckVFMFU6H47gu4O5FJAnDXQUXrRT9gGTS/GPvBWQDIfeAy3uQs9ObF0ZMb/9Kt3GQMG6x5wCmUGn/J06X4hUX+241yeS02wEXMAofAdPeaKMV8A4Zp2J6G5CQOke2NXY6smr4OVeYIxYy4U3Zgo/TpII0QEkPqadA+uNUQ3HWIU= ; Message-ID: <20060306152158.81224.qmail@web54312.mail.yahoo.com> Received: from [213.91.244.26] by web54312.mail.yahoo.com via HTTP; Mon, 06 Mar 2006 07:21:58 PST Date: Mon, 6 Mar 2006 07:21:58 -0800 (PST) From: Emil Rachovsky Subject: Syntax error in Execute statement To: "pgsql-general@postgresql.org" Cc: "pgsql-sql@postgresql.org" MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.948 required=5 tests=[AWL=-0.410, DNS_FROM_RFC_ABUSE=0.479, DNS_FROM_RFC_WHOIS=0.879] X-Spam-Score: 0.948 X-Spam-Level: X-Archive-Number: 200603/207 X-Sequence-Number: 92072 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