Skip site navigation (1) Skip section navigation (2)

Re: Help with prepared statment for crosstab

From: Kris Jurka <books(at)ejurka(dot)com>
To: Carl Shelbourne <Carl(dot)Shelbourne(at)stanleybet(dot)com>
Cc: "'pgsql-jdbc(at)postgresql(dot)org'" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Help with prepared statment for crosstab
Date: 2009-11-03 18:21:50
Message-ID: alpine.BSO.2.00.0911031317580.29390@leary.csoft.net (view raw or flat)
Thread:
Lists: pgsql-jdbc

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

In response to

pgsql-jdbc by date

Next:From: Michael WoodDate: 2009-11-03 18:29:08
Subject: Re: [NOVICE] Bug - DatabaseMetaData.getCatalogs() was [Novice] Can't get list of databases with \list
Previous:From: Kris JurkaDate: 2009-11-03 18:16:15
Subject: Re: Bug - DatabaseMetaData.getCatalogs() was [Novice] Can't get list of databases with \list

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group