Re: Problem with string parameters

From: Giuseppe Sacco <giuseppe(at)eppesuigoccas(dot)homedns(dot)org>
To: RichT <rricht(at)pacbell(dot)net>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Problem with string parameters
Date: 2007-03-26 08:05:59
Message-ID: 1174896359.2114.10.camel@scarafaggio
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

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

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Joseph S 2007-03-28 00:45:35 Lots of junk on my console
Previous Message RichT 2007-03-24 19:35:46 Problem with string parameters