Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id BD7626345FB for ; Tue, 3 Nov 2009 14:21:58 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 05013-01 for ; Tue, 3 Nov 2009 18:21:51 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from leary.csoft.net (leary.csoft.net [205.205.214.5]) by mail.postgresql.org (Postfix) with ESMTP id 3C6C46345C0 for ; Tue, 3 Nov 2009 14:21:51 -0400 (AST) Received: by leary.csoft.net (Postfix, from userid 1112) id 4D77EA35B; Tue, 3 Nov 2009 13:21:50 -0500 (EST) Date: Tue, 3 Nov 2009 13:21:50 -0500 (EST) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: Carl Shelbourne cc: "'pgsql-jdbc@postgresql.org'" Subject: Re: Help with prepared statment for crosstab In-Reply-To: <747BBD65CFF0834A90A43031630CA9EE4B5D4B47AB@sibexchange.stanleybet.com> Message-ID: References: <747BBD65CFF0834A90A43031630CA9EE4B5D4B47AB@sibexchange.stanleybet.com> User-Agent: Alpine 2.00 (BSO 1167 2008-08-23) MIME-Version: 1.0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Archive-Number: 200911/4 X-Sequence-Number: 20051 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: >=20 > Caused=A0by:=A0org.postgresql.util.PSQLException:=A0The=A0column=A0index= =A0is=A0out=A0of=A0ra > nge:=A01,=A0number=A0of=A0columns:=A00.=A0 The ? parameters you've used are inside a string literal, so they are not= =20 considered parameters. Consider: SELECT 'Does this work?'; The question mark is part of the literal, not a parameter. Kris Jurka=