From: Giuseppe Sacco <giuseppe@eppesuigoccas.homedns.org>
To: RichT <rricht@pacbell.net>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Problem with string parameters
Date: Mon, 26 Mar 2007 10:05:59 +0200
Message-ID: <1174896359.2114.10.camel@scarafaggio> (raw)
In-Reply-To: <1174764946.377183.140290@y80g2000hsf.googlegroups.com>
References: <1174764946.377183.140290@y80g2000hsf.googlegroups.com>
Il giorno sab, 24/03/2007 alle 12.35 -0700, RichT ha scritto:
> Can anyone help with this?
>
> I am using Postgres 7.4.13 JDBC interface and I get
> "PSQLException: Parameter index out of range."
>
> The query is:
> INSERT INTO shm_log_sources
> SELECT ? as name, ci.source_id, true as active, true as monitor,
> 0 as alerts_sent, '' as comment
> FROM shm_current_ids ci LEFT OUTER JOIN shm_log_sources ls
> ON ci.source_id = ls.source_id AND ls.name = ?
> WHERE ls.active IS NULL
[...]
I think you may only bind variable in the WHERE clause. You cannot bud
variable in the SELECT part.
Bye,
Giuseppe
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: giuseppe@eppesuigoccas.homedns.org, rricht@pacbell.net
Subject: Re: Problem with string parameters
In-Reply-To: <1174896359.2114.10.camel@scarafaggio>
References: <1174764946.377183.140290@y80g2000hsf.googlegroups.com> <1174896359.2114.10.camel@scarafaggio>
* 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