|
View:
New views
2 Messages
—
Rating Filter:
Alert me
|
|
|
Help with prepared statment for crosstabHi. I have been asked to produce a report for a new game. The
report needs to show the gamers unique id, gamer_number, his nickname, the
average score of the best 5 scores he got playing the game during a specified
period and a list of the top five scores that made this average. e.g.: gamerNumber;nickname;average;score1;score2;score3;score4;score5 91692656912;"nickname1";"14.33";29.85;21.03;7.38;6.73;6.66 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 range: 1, number of columns: 0. I am not too sure if this is possible, but I am trying to
prepare a statement containing a crosstab: SELECT
left join player pl on g.gamer_number=pl.gamer_number Running against Postgres 8.3.8 running on Windows
XP. Tried with jdbc drivers 8.3-603.jdbc3 and 8.4-701.jdbc3 Is this possible? How do I escape the parameters within the crosstab?
Is it the crosstab that is the issue even? Any help would be most welcome. Thanks Carl This email and its attachments are intended for the above named only and may be confidential. If you have received them in error please notify the sender immediately and delete all records of the email and its attachments from your computer. Unless you are the intended recipient you must not read, copy, distribute, use or retain this email or any attachments or any part of them. Although we aim to use efficient virus checking procedures for emails and attachments we accept no liability for viruses and it is the recipient's responsibility to ensure they are actually virus free. Stanley International Betting | 201 - 210 Mercury Court | Tithebarn Street | Liverpool | L2 2QP | +44 151 235 2000 | Registered in England with no.3357517 |
|
|
Re: Help with prepared statment for crosstabOn 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 -- Sent via pgsql-jdbc mailing list (pgsql-jdbc@...) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc |
| Free embeddable forum powered by Nabble | Forum Help |