From: | Thomas Kellerer <spam_eater(at)gmx(dot)net> |
---|---|
To: | pgsql-sql(at)lists(dot)postgresql(dot)org |
Subject: | Re: how to resolve org.postgresql.util.PSQLException: ERROR: operator does not exist: text = integer? |
Date: | 2019-07-16 08:57:25 |
Message-ID: | db44d9c7-1ed5-f890-e5cf-1b5fc561fdb2@gmx.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
Karen Goh schrieb am 16.07.2019 um 10:21:
> Can I know which forum to post to cos I think this may be the wrong
> forum. Cos it is sql so this forum maybe for sql execute inside the
> database. However, I read there is no more jdbc forum, correct me if
> I am wrong.
While this mailing lists indeed deals with plain SQL topics, your problem is not completely off-topic.
But the reason why you don't get help is, that you are not supplying enough information so that we can help you.
The code you have shown us, doesn't show the *actual* SQL String that is generated (and send to the database).
So it's impossible to know to which parameter the error message refers to
Is it the use of "ps2.setInt(1, tutor_id);" or maybe the use of "ps2.setString(2, item)"?
It's vital to know how that parameter is used in the actual (generated) SQL query.
Given the error message, I assume(!) that the tutor_id is used together with a varchar/text column.
However Postgres will refuse to compare integer and string values.
That would be similar to writing "someStringVariable.equals(42)" in Java - you wouldn't do that either.
So what we need from you in order to be able to help you is:
* The actual generated and complete SQL string of the query you are building.
Add System.out.println(sql1) to your code and then show us that result
* The definition of the table columns that are used together with the parameters (the "?" in the printed SQL string)
Thomas
Sent with Mozilla Thunderbird
From | Date | Subject | |
---|---|---|---|
Next Message | Karen Goh | 2019-07-16 09:25:15 | Re: Fw: how to resolve org.postgresql.util.PSQLException: ERROR: operator does not exist: text = integer? |
Previous Message | Andrew Gierth | 2019-07-16 08:54:44 | Re: Fw: how to resolve org.postgresql.util.PSQLException: ERROR: operator does not exist: text = integer? |