pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Jowett <oliver@opencloud.com>
To: Brady S Edwards <brady.s.edwards@seagate.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: JDBC parameter binding not working for PL/PGSQL block JDBC3 Version 9.0-801
Date: Thu, 28 Apr 2011 08:17:39 +1200
Message-ID: <BANLkTikUNphfgrEf70_JKaC9B3bsr_tVHw@mail.gmail.com> (raw)
In-Reply-To: <BANLkTi=vNEroPFa159HUw9DcxWuj=yHSwA@mail.gmail.com>
References: <BANLkTi=vNEroPFa159HUw9DcxWuj=yHSwA@mail.gmail.com>

On 28 April 2011 07:35, Brady S Edwards <brady.s.edwards@seagate.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



view thread (5+ messages)  latest in thread

Message-ID: <BANLkTikUNphfgrEf70_JKaC9B3bsr_tVHw@mail.gmail.com>
Permalink:  ../BANLkTikUNphfgrEf70_JKaC9B3bsr_tVHw@mail.gmail.com/
Also on:    postgresql.org/message-id/BANLkTikUNphfgrEf70_JKaC9B3bsr_tVHw@mail.gmail.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 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: oliver@opencloud.com, brady.s.edwards@seagate.com
  Subject: Re: JDBC parameter binding not working for PL/PGSQL block JDBC3 Version 9.0-801
  In-Reply-To: <BANLkTikUNphfgrEf70_JKaC9B3bsr_tVHw@mail.gmail.com>
  References: <BANLkTi=vNEroPFa159HUw9DcxWuj=yHSwA@mail.gmail.com> <BANLkTikUNphfgrEf70_JKaC9B3bsr_tVHw@mail.gmail.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