From: Kris Jurka <books@ejurka.com>
To: Carl Shelbourne <Carl.Shelbourne@stanleybet.com>
Cc: 'pgsql-jdbc@postgresql.org' <pgsql-jdbc@postgresql.org>
Subject: Re: Help with prepared statment for crosstab
Date: Tue, 3 Nov 2009 13:21:50 -0500 (EST)
Message-ID: <alpine.BSO.2.00.0911031317580.29390@leary.csoft.net> (raw)
In-Reply-To: <747BBD65CFF0834A90A43031630CA9EE4B5D4B47AB@sibexchange.stanleybet.com>
References: <747BBD65CFF0834A90A43031630CA9EE4B5D4B47AB@sibexchange.stanleybet.com>
On Tue, 3 Nov 2009, Carl Shelbourne wrote:
> The SQL shown below works if I do not have any parameters, but when I add
> the parameters, I get:
>
> Caused by: org.postgresql.util.PSQLException: The column index is out of ra
> nge: 1, number of columns: 0.
The ? parameters you've used are inside a string literal, so they are not
considered parameters. Consider:
SELECT 'Does this work?';
The question mark is part of the literal, not a parameter.
Kris Jurka
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: books@ejurka.com, Carl.Shelbourne@stanleybet.com
Subject: Re: Help with prepared statment for crosstab
In-Reply-To: <alpine.BSO.2.00.0911031317580.29390@leary.csoft.net>
References: <747BBD65CFF0834A90A43031630CA9EE4B5D4B47AB@sibexchange.stanleybet.com> <alpine.BSO.2.00.0911031317580.29390@leary.csoft.net>
* 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