agora inbox for pgsql-sql@postgresql.org
help / color / mirror / Atom feedFrom: Thomas Kellerer <spam_eater@gmx.net>
To: pgsql-sql@lists.postgresql.org
Subject: Re: how to resolve org.postgresql.util.PSQLException: ERROR: operator does not exist: text = integer?
Date: Tue, 16 Jul 2019 10:57:25 +0200
Message-ID: <db44d9c7-1ed5-f890-e5cf-1b5fc561fdb2@gmx.net> (raw)
In-Reply-To: <59735533.1068095.1563265280844@mail.yahoo.com>
References: <110414461.528890.1563075361778@mail.yahoo.com>
<1846547624.530883.1563075598322@mail.yahoo.com>
<CAKFQuwaLmrFiSAOjzcK2-43F-016CZhP5iRpnyzJ0PzsKEgzog@mail.gmail.com>
<40544440.741577.1563178850210@mail.yahoo.com>
<CAKFQuwYJsFw9p_qLyashvUmONFZre9OxgEWxDkqdY6-gWB9G7A@mail.gmail.com>
<768811852.1032981.1563242356010@mail.yahoo.com>
<CAKFQuwaC_Z24XxjvsSgYPvSNpu+K1Z9_60auVxEpjFQpE5zrFg@mail.gmail.com>
<774271584.1091322.1563257675315@mail.yahoo.com>
<1984680550.1098414.1563257845450@mail.yahoo.com>
<f11f7f05-e3fc-2794-e4ec-4b7144ae56be@stb-datenservice.de>
<59735533.1068095.1563265280844@mail.yahoo.com>
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
view thread (24+ messages) latest in thread
Message-ID: <db44d9c7-1ed5-f890-e5cf-1b5fc561fdb2@gmx.net>
Permalink: ../db44d9c7-1ed5-f890-e5cf-1b5fc561fdb2@gmx.net/
Also on: postgresql.org/message-id/db44d9c7-1ed5-f890-e5cf-1b5fc561fdb2@gmx.net
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: spam_eater@gmx.net, pgsql-sql@lists.postgresql.org
Subject: Re: how to resolve org.postgresql.util.PSQLException: ERROR: operator does not exist: text = integer?
In-Reply-To: <db44d9c7-1ed5-f890-e5cf-1b5fc561fdb2@gmx.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox