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 1hnGmO-0004ss-1n for pgsql-sql@arkaria.postgresql.org; Tue, 16 Jul 2019 06:17: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 1hnGmM-00081L-NL for pgsql-sql@arkaria.postgresql.org; Tue, 16 Jul 2019 06:17:34 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hnGmM-00081E-6y for pgsql-sql@lists.postgresql.org; Tue, 16 Jul 2019 06:17:34 +0000 Received: from sonic306-1.consmr.mail.bf2.yahoo.com ([74.6.132.40]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1hnGmJ-0003Wq-Dv for pgsql-sql@lists.postgresql.org; Tue, 16 Jul 2019 06:17:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1563257849; bh=CsmiXMKM80H0qPvSUiS77CbMFyuKTLaxkfIDdOQX7SY=; h=Date:From:To:In-Reply-To:References:Subject:From:Subject; b=X+sQSs8LUjQSktXQS24JLcahARpG0bJ8qSlIifjkZHOBY4wIE4PKaE1sxPBwenNevz7VQZ5ksb5peHws6F5Vv3ZUlEGUu9nhk2jM7lAzZSecQs0ag3o/rxaAgnAOi+dsfOlUMrhLTWo8JXCNNPaS02sA3OQ9LqaeUmeG9rnHxviPBhya+wRBzukOTe83dI9kuE+hzGmVKR3yKSwuyTkL4uesas7/PH5anKl8olRhAtBs9lDLwcPPuo34d6RrvT6SkiEgAszFtSBZSqGfAQjBI57ihnBoPKff+O4Vrw5LydMxL2vKY5h/ahTX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SHlg3x7kohYnzq0P.11J6Vm1Qwfy Rvxyti1d2hIlnGLl4LhW2KilBeKz3VZyeNS1oxe67i0tMor2UI2ImjlkY0u1RmhlPEJVpONcyQvR GgZl8kHw_4VikuoDi1Un_sF7tnlNsmdWWgJKa.m3Mzdgwuu5gZqyWJ7l.hJjv.GR3SpSqUAT8XUK zzOSBrYq_ixVNZ6olGJnGZRs.9.ENqVe1XTPsZ0BYj6F2kWGMYfXnJG492AHxcg2acmfQBNWwn2W Cw18cmeD3ow_GwDdcWC5Y.0AzqbZIj7R85Ng0zefY3faKatORBFZvSr8NlAiX Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.bf2.yahoo.com with HTTP; Tue, 16 Jul 2019 06:17:29 +0000 Date: Tue, 16 Jul 2019 06:17:25 +0000 (UTC) From: Karen Goh To: "pgsql-sql@lists.postgresql.org" Message-ID: <1984680550.1098414.1563257845450@mail.yahoo.com> In-Reply-To: <774271584.1091322.1563257675315@mail.yahoo.com> 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> Subject: 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_1098413_1121962485.1563257845447" X-Mailer: WebService/1.1.13991 YahooMailIosMobile Yahoo%20Mail/45955 CFNetwork/978.0.7 Darwin/18.6.0 Content-Length: 24041 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ------=_Part_1098413_1121962485.1563257845447 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, This is a continuation of 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 i= s 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.PSQLException: ERROR: operator does not exist: text =3D= integer =C2=A0 Hint: No operator matches the given name and argument type(s). You m= ight need to add explicit type casts. =C2=A0 Position: 69 =C2=A0=C2=A0=C2=A0 at org.postgresql.core.v3.QueryExecutorImpl.receiveError= Response(QueryExecutorImpl.java:2433) =C2=A0=C2=A0=C2=A0 at org.postgresql.core.v3.QueryExecutorImpl.processResul= ts(QueryExecutorImpl.java:2178) =C2=A0=C2=A0=C2=A0 at org.postgresql.core.v3.QueryExecutorImpl.execute(Quer= yExecutorImpl.java:306) =C2=A0=C2=A0=C2=A0 at org.postgresql.jdbc.PgStatement.executeInternal(PgSta= tement.java:441) =C2=A0=C2=A0=C2=A0 at org.postgresql.jdbc.PgStatement.execute(PgStatement.j= ava:365) =C2=A0=C2=A0=C2=A0 at org.postgresql.jdbc.PgPreparedStatement.executeWithFl= ags(PgPreparedStatement.java:155) =C2=A0=C2=A0=C2=A0 at org.postgresql.jdbc.PgPreparedStatement.executeQuery(= PgPreparedStatement.java:118) =C2=A0=C2=A0=C2=A0 at Controller.searchController.doPost(searchController.j= ava:108) Here's the code snippet which I do not know where I had gone wrong: =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 String sql1 =3D "s= elect 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).toString()= + ")"; =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 PreparedStatement = 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 t= utor.getTutor_id(); =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0 =C2=A0 ps2.setInt(1, 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 if (item !=3D null) { =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0=C2=A0 subjs.add(item= ); =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.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 wrote: Attn to all: For sone kind of strange reason I do not know why the mail is not sent to a= ll. 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 iPhone Begin forwarded message: On Tuesday, July 16, 2019, 1:01 PM, David G. Johnston wrote: On Mon, Jul 15, 2019 at 6:59 PM Karen Goh 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 base= d 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);=C2=A0 is supposed to accomplish in your code. David J. ------=_Part_1098413_1121962485.1563257845447 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi,

<= /span>
This is a continuation of 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 wh= ich is in this case subject_names from a table which contains both the tuto= r_id and the subject_names.

Here's the error message:

org.p= ostgresql.util.PSQLException: ERROR: operator does not exist: text =3D inte= ger
  Hint: No operator match= es the given name and argument type(s). You might need to add explicit type= casts.
  Position: 69
    at org.postgresql.cor= e.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2433)
    at org.postgresql= .core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2178)
    at org.postgresql.c= ore.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:306)
    at org.postgresql.jdbc.PgStat= ement.executeInternal(PgStatement.java:441)
    at org.postgresql.jdbc.PgStatement.execute(PgS= tatement.java:365)
  &nb= sp; at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedS= tatement.java:155)
  &nb= sp; at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedState= ment.java: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 fr= om tutor_subject where subject_name in ("
             &nbs= p;      + builder.deleteCharAt(builder.length() - 1).to= String() + ")";

          =   PreparedStatement ps2 =3D connection.prepareStatement(sql1);
HashMap<Integer, ArrayList<String&g= t;> tutorSubject =3D new HashMap<Integer, ArrayList<String>>= ();            
for(String item : subjs) {
          = ;  int tutor_id =3D tutor.getTutor_id();
            ps2.setInt(= 1, tutor_id);            
            if (it= em !=3D null) {
    &nb= sp;           subjs.add(item);
            ps2.se= tString(2, item);     
<= span style=3D"-webkit-text-size-adjust: auto; background-color: rgba(255, 2= 55, 255, 0);">            }    &nbs= p;                  =    
  &nb= sp;         ps2.executeQuery();
        while (rs= .next()) {
    &nbs= p;               tut= or_id =3D rs.getInt("tutor_id");  
             &= nbsp;      subjs.add(rs.getString("subject_name"));
       =                = ;               &nbs= p;     
 =                 = ;       tutorSubject.put(tutor_id, subjs); &n= bsp;  
   = ;               &nbs= p;     System.out.println(tutorSubject);
          &nb= sp;             }
         &n= bsp;  
   = ;         System.out.println("tutor ID=3D" + = rs.getInt("tutor_id") + ", subjectName=3D" + rs.getString("subject_name"));=


Hope someone could poi= nt 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:

<= div id=3D"yiv6928561930">
Attn to all:

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

I have normally wrote n replied to the last person who wrot= e 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 iPhone

Begin forwarded message:

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

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

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 fr= om the same table based on the no of ? in subjectName as per parameterValue= s.

Again, you need to send messages to the mailing, not me perso= nally.

= That said you might want to first figure out what:
=
ps2.setInt(1, tutor_id); <= br clear=3D"none">

is supposed to accomplish in your code.
<= br clear=3D"none">
David J.

------=_Part_1098413_1121962485.1563257845447--