Re: JDBC parameter binding not working for PL/PGSQL block JDBC3 Version 9.0-801

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Brady S Edwards <brady(dot)s(dot)edwards(at)seagate(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: JDBC parameter binding not working for PL/PGSQL block JDBC3 Version 9.0-801
Date: 2011-04-27 20:17:39
Message-ID: BANLkTikUNphfgrEf70_JKaC9B3bsr_tVHw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On 28 April 2011 07:35, Brady S Edwards <brady(dot)s(dot)edwards(at)seagate(dot)com> wrote:

> When trying to setString(1,?) where the ? is in a pl/pgsql block I get an
> error.

? is not considered a parameter marker if it occurs inside a literal string.
The pl/pgsql code in your case is one big literal string (delimited by $$)

It's just the same case as "SELECT 'should this be a parameter?'",
which is a query that takes no parameters despite happening to contain
a ? character.

Oliver

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Lew 2011-04-27 21:39:23 Re: O/T: Class.forName(driver) repeatedly? [Was: JDBC parameter binding not working for PL/PGSQL block JDBC3 Version 9.0-801]
Previous Message Brady S Edwards 2011-04-27 20:11:38 JDBC parameter binding not working for PL/PGSQL block JDBC3 Version 9.0-801