Re: how to resolve org.postgresql.util.PSQLException: ERROR: operatordoes not exist: text = integer?

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: how to resolve org.postgresql.util.PSQLException: ERROR: operatordoes not exist: text = integer?
Дата
Msg-id CAKFQuwb_G5L9sY8hFxKD=HW_dGS57tmn+geL1ztGBMB4kWsUMQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: how to resolve org.postgresql.util.PSQLException: ERROR:operator does not exist: text = integer?  (Karen Goh <karenworld@yahoo.com>)
Список pgsql-sql
On Tue, Jul 16, 2019 at 8:44 AM Karen Goh <karenworld@yahoo.com> wrote:
I have been told In clause in the way to do it.
So, not sure why am I getting that error....

Your query only has one comparison operation, ANY. In order for the query to get as far as it did it must have two question marks present in the ANY expression (since you've set two parameters in Java).  Since the left side of the ANY equality is subject_name you are attempting to compare against the text type.

So explain why you think sticking an integer into the first parameter location is something that makes sense here; i.e., ps2.setInt(1, tutor_id); because that, with the information you've provided, is your error.

David J.

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

Предыдущее
От: Karen Goh
Дата:
Сообщение: Re: how to resolve org.postgresql.util.PSQLException: ERROR:operator does not exist: text = integer?
Следующее
От: Andrew Gierth
Дата:
Сообщение: IN vs arrays (was: Re: how to resolve org.postgresql.util.PSQLException: ERROR: operator does not exist: text = integer?)