Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hnIiO-0001Q7-90 for pgsql-sql@arkaria.postgresql.org; Tue, 16 Jul 2019 08:21:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hnIiM-0008Ou-KZ for pgsql-sql@arkaria.postgresql.org; Tue, 16 Jul 2019 08:21:34 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hnIiM-0008On-1j for pgsql-sql@lists.postgresql.org; Tue, 16 Jul 2019 08:21:34 +0000 Received: from sonic304-56.consmr.mail.bf2.yahoo.com ([74.6.128.31]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hnIiI-0007o5-NR for pgsql-sql@lists.postgresql.org; Tue, 16 Jul 2019 08:21:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1563265287; bh=xc6+Dz+u+P5ekkV49APWXD/Uu4kMqBizwvgRQSQhcCI=; h=Date:From:To:In-Reply-To:References:Subject:From:Subject; b=T/kdzvQzjhmaymWhxYNxOVbVuKzl6Egbec/5gksKWVtAwc8ncrKhMbI1XAI88e/HReUlQC9A/XdQu4lSEIdIYUZxlK/OTH6TZi8dExY72c+5QkrQY/Gk2m8Z23qczU9CbfNiqzXF6yGoet1tv+nFpGrJrxj//fapwqxiUfziJ6WVviR8IkizT54G97qbFLTttn6PwbyP/WeLOHeSZr761MczveRJ3U0un1h9Enx+VV+SMnN8/IKekgt58aGZ9DmGd6WZIyG6lSUEAomnSbYZE4A5T3qPJmKIYae8U4rmdLuggrZT+1t8HbaE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QISt0g_ehUCZJC BB4tV81.oOfIyEGf6.roviw61UINzaSxrTyfiQHZKhcLUWQ8j5.Hvc_3Yl3lgAbfFOtLxKR9FiOJ G6u1_7Rn2s2WyjdkzFNjDMRF42E5Q0A9m4IakNeWu01A_Ps_ngWYgpmyPjWuoHoWO33G6EsSpfaj jSNKAHzHnGJe9YSyCFp0ocWWpdziPW8ZZnB0RptG30sIVTiNklzkUxFMtp4p0PS3p9N8Co0zCfon hu4eJjAv7O6X5P.tO3.wcW.6DIS3BSx.s_0XkgMtkh97m6NOnQ_6BUzZY5detg0PYQQ-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.bf2.yahoo.com with HTTP; Tue, 16 Jul 2019 08:21:27 +0000 Date: Tue, 16 Jul 2019 08:21:20 +0000 (UTC) From: Karen Goh To: =?UTF-8?Q?Martin_St=C3=B6cker?= , Message-ID: <59735533.1068095.1563265280844@mail.yahoo.com> In-Reply-To: References: <110414461.528890.1563075361778@mail.yahoo.com> <1846547624.530883.1563075598322@mail.yahoo.com> <40544440.741577.1563178850210@mail.yahoo.com> <768811852.1032981.1563242356010@mail.yahoo.com> <774271584.1091322.1563257675315@mail.yahoo.com> <1984680550.1098414.1563257845450@mail.yahoo.com> Subject: Re: Fw: how to resolve org.postgresql.util.PSQLException: ERROR: operator does not exist: text = integer? MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1068094_1770268677.1563265280841" X-Mailer: WebService/1.1.13991 YahooMailIosMobile Yahoo%20Mail/45955 CFNetwork/978.0.7 Darwin/18.6.0 Content-Length: 26007 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ------=_Part_1068094_1770268677.1563265280841 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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. Howe= ver, I read there is no more jdbc forum, correct me if I am wrong. Sent from Yahoo Mail for iPhone On Tuesday, July 16, 2019, 2:25 PM, Martin St=C3=B6cker wrote: Hi, =20 please post your statement but not all this java stuff. Nobody knows the type and content of your builder varaible. =20 Regards Martin =20 =20 =20 =20 Am 16.07.2019 um 08:17 schrieb Karen Goh: =20 =20 Hi, =20 This is a continuation of my last problem - not sure if I should write fr= om there cos the first part was solved with the help from this group. =20 I was trying to get the matching tutor_id with the parameter values which= is in this case subject_names from a table which contains both the tutor_i= d and the subject_names. =20 Here's the error message: =20 org.postgresql.util.PSQLException: ERROR: operator does not exist: text = =3D integer =C2=A0 Hint: No operator matches the given name and argument type(s). You= might need to add explicit type casts. =C2=A0 Position: 69 =C2=A0=C2=A0=C2=A0 atorg.postgresql.core.v3.QueryExecutorImpl.receiveErro= rResponse(QueryExecutorImpl.java:2433) =C2=A0=C2=A0=C2=A0 atorg.postgresql.core.v3.QueryExecutorImpl.processResu= lts(QueryExecutorImpl.java:2178) =C2=A0=C2=A0=C2=A0 atorg.postgresql.core.v3.QueryExecutorImpl.execute(Que= ryExecutorImpl.java:306) =C2=A0=C2=A0=C2=A0 at org.postgresql.jdbc.PgStatement.executeInternal(PgS= tatement.java:441) =C2=A0=C2=A0=C2=A0 at org.postgresql.jdbc.PgStatement.execute(PgStatement= .java:365) =C2=A0=C2=A0=C2=A0 atorg.postgresql.jdbc.PgPreparedStatement.executeWithF= lags(PgPreparedStatement.java:155) =C2=A0=C2=A0=C2=A0 atorg.postgresql.jdbc.PgPreparedStatement.executeQuery= (PgPreparedStatement.java:118) =C2=A0=C2=A0=C2=A0 at Controller.searchController.doPost(searchController= .java:108) =20 Here's the code snippet which I do not know where I had gone wrong: =20 =20 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 String sql1 =3D = "select tutor_id, subject_name from tutor_subject where subject_name in (" =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 + builder.deleteCharAt(builder.length() - 1).toStrin= g() + ")"; =20 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 PreparedStatemen= t ps2 =3D connection.prepareStatement(sql1); HashMap> tutorSubject =3D new HashMap>();=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0=C2=A0 for(String item : subjs) { =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 int tutor_id =3D= tutor.getTutor_id(); =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0 =C2=A0 ps2.setInt(1, tutor_i= d);=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (item !=3D null) { =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0=C2=A0 subjs.add(it= em); =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ps2.setString(2, item);=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 ps2.executeQuery= (); =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 while (rs.next()) { =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 tutor_id =3D rs.getInt("tutor_id");=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 subjs.add(rs.getString("subject_name")); =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0= =C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 tutorSubject.put(tutor_id, subjs)= ;=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 System.out.println(tutorSubject); =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 } =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 System.out.print= ln("tutor ID=3D" + rs.getInt("tutor_id") + ", subjectName=3D" + rs.getStrin= g("subject_name")); =20 =20 Hope someone could point out my mistake. =20 Thanks.=20 =20 Sent from Yahoo Mail for iPhone =20 =20 Begin forwarded message: =20 On Tuesday, July 16, 2019, 2:14 PM, Karen Goh wrote= : =20 Attn to all:=20 For sone kind of strange reason I do not know why the mail is not sent to= all.=20 I have normally wrote n replied to the last person who wrote but yahoo ma= il didn=E2=80=99t let me write at there.=20 Hope everyone receives this mail this time round.=20 N please help me.=20 Tks!=20 =20 =20 =20 Sent from Yahoo Mail for iPhone =20 =20 Begin forwarded message: =20 On Tuesday, July 16, 2019, 1:01 PM, David G. Johnston wrote: =20 On Mon, Jul 15, 2019 at 6:59 PM Karen Goh wrote= : =20 =20 May I know why did you say I am comparing subject_name to an integer ? =20 I am trying to get both tutor_id and subject_name from the same table base= d on the no of ? in subjectName as per parameterValues. =20 =20 Again, you need to send messages to the mailing, not me personally.=20 That said you might want to first figure out what:=20 ps2.setInt(1, tutor_id);=C2=A0 =20 is supposed to accomplish in your code. =20 David J.=20 =20 =20 =20 --=20 Widdersdorfer Str. 415, 50933 K=C3=B6ln; Tel. +49 / 221 / 9544 010 HRB K=C3=B6ln HRB 75439, Gesch=C3=A4ftsf=C3=BChrer: Dr. Dirk Goldner=20 ------=_Part_1068094_1770268677.1563265280841 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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. Howe= ver, I read there is no more jdbc forum, correct me if I am wrong.

<= br>Sent from Yahoo = Mail for iPhone

On Tuesday, Jul= y 16, 2019, 2:25 PM, Martin St=C3=B6cker <martin.stoecker@stb-datenservi= ce.de> wrote:

Hi,

please post your statement but not all this java stuff.
Nobody knows the type and content of your builder varaible.

Regards Martin




Am 16.07.2019 um 08:17 schrie= b Karen Goh:
Hi,

This is a continuation o= f my last problem - not sure if I should write from there cos the first part was solved with the help from this group.

I was trying to get the = matching tutor_id with the parameter values which is in this case subject_names from a table which contains both the tutor_id and the subject_names.

Here's the error message= :

org.postgresql.util.PSQL= Exception: ERROR: operator does not exist: text =3D integer
  Hint: No operator= matches the given name and argument type(s). You might need to add explicit type casts.
  Position: 69
    at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutor= Impl.java:2433)
    at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.j= ava:2178)
    at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:306= )
    at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:= 441)
    at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)
    at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatemen= t.java:155)
    at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.ja= va:118)
    at Controller.searchController.doPost(searchController.java:108)

Here's the code snippet = which I do not know where I had gone wrong:


     = ;       String sql1 =3D "select tutor_id, subject_name from tutor_subject where subject_name in ("
     = ;               + builder.deleteCharAt(builder.length() - 1).toString() + ")";

     = ;       PreparedStatement ps2 =3D connection.prepareStatement(sql1);
HashMap<Integer, ArrayList<String>> tutorSubject =3D new HashMap<Integer, ArrayList<String>>();  &nb= sp;         
for(String item : subjs)= {
     = ;       int tutor_id =3D tutor.getTutor_id();
     = ;       ps2.setInt(1, tutor_id);            
      &nb= sp;     if (item !=3D null) {
      &nb= sp;         subjs.add(item);
      &nb= sp;     ps2.setString(2, item);     
      &nb= sp;     }               &= nbsp;          
     = ;       ps2.executeQuery();
     = ;   while (rs.next()) {
     = ;               tuto= r_id =3D rs.getInt("tutor_id");  
     = ;               subjs.add(rs.getString("subject_name"));
     = ;               &nbs= p;                       
     = ;               &nbs= p;   tutorSubject.put(tutor_id, subjs);    
     = ;               &nbs= p;   System.out.println(tutorSubject);
     = ;               &nbs= p;   }
     = ;       
     = ;       System.out.println("tutor ID=3D" + rs.getInt("tutor_id") + ", subjectName=3D" + rs.getString("subject_name"));


Hope someone could point= out my mistake.

Thanks.


Sent from Yahoo Mail for iPhone

Begin forwarded message:

On Tuesday, July 16, 2019, 2:14 PM, Karen Goh <karenworld@yahoo.com> wrote:

Attn to all:

For sone kind of strange reason I do not know why the mail is not sent to all.

I have normally wrote n replied to the last person who wrote but yahoo mail didn=E2=80=99t let me write at there.

Hope everyone receives this mail this time round.

N please help me.

Tks!




Sent from Yahoo Mail for iPhon= e

Begin forwarded message:

On Tuesday, July 16, 2019, 1:01 PM, David G. Johnston <david.g.johnston= @gmail.com> wrote:

On Mon, Jul 15, 2019 at 6:59 PM Karen Goh <karenworld@yahoo.com> wrote:

May I know why did you say I am comparing subject_name to an integer ?

I am trying to get both tutor_id and subject_name from the same table based on the no of ? in subjectName as per parameterValues.

Again, you need to send messages to the mailing, not me personally.

That said you might want to first figure out what:

ps2.setInt(1, tutor_id);&nbs= p;

is supposed to accomplish in your code.

David J.

=20
--=20

Widdersdorfer Str. 415, 50933 K=C3=B6ln; Tel. +49 / 221 =
/ 9544 010
HRB K=C3=B6ln HRB 75439, Gesch=C3=A4ftsf=C3=BChrer: Dr. Dirk Goldner
<= div class=3D"yiv5577966965yqt0751338713" id=3D"yiv5577966965yqtfd02134">
------=_Part_1068094_1770268677.1563265280841--