skip to Main Content

I have simple query:

/* crm_person */ 
        
            select /*query crm_person*/ 
              crm_pers.*
            from crm_person crm_pers
            where 1=1
         and crm_pers.id = ?

And params map:

enter image description here

As result I am getting error – org.postgresql.util.PSQLException: ERROR: operator does not exist: bigint = character varying
Hint: No operator matches the given name and argument types. You might need to add explicit type casts.
Position: 133

2

Answers


  1. Chosen as BEST ANSWER

    For me problem was groovy script, which set parameter id as string if not specified:

    def params = utils.queries.params().put("id", personId).getMap()
    

    so this helped:

    def params = utils.queries.params().put("id", personId as Long).getMap()
    

  2. As the error states, the column is a (big) integer, which should be equivalent to Java’s long. Instead of using setObject with a string, you can use setLong:

    ps.setLong(1, Long.parseLong(param);
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search