query works in psql, but not thru JDBC

Поиск
Список
Период
Сортировка
От Arsalan Zaidi
Тема query works in psql, but not thru JDBC
Дата
Msg-id 006a01c0edad$9fd16800$4301a8c0@directi.com
обсуждение исходный текст
Ответы Re: query works in psql, but not thru JDBC  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-interfaces
Hi.

I'm running this query, which is constructed from parameters passed to a
function.

SELECT * FROM users WHERE userid = 4 ORDER BY name LIMIT 20 OFFSET 0

When I run it from the command line inpsql, It works just fine, but when I
run it using the Postgresql JDBC driver (executeQuery()), I get this error

------------------------
Err Mesg : ERROR: Attribute users.name must be GROUPed or used in an
aggregate function

SQL State : NULL
Error Code : 0
------------------------

Why does it work from the command line and not through JDBC?

Thanks in advance.

--Arsalan.



В списке pgsql-interfaces по дате отправления:

Предыдущее
От: Dave Page
Дата:
Сообщение: RE: What is the difference between the two MSI insta llers?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: query works in psql, but not thru JDBC