Article - CS346927

Error when executing a SQL Query service "operator does not exist" or "cannot invoke Iprimitive.getStringValue()" in ThingWorx

Modified: 14-Jun-2021   


Applies To

  • ThingWorx Platform 9.1

Description

  • Using a database to execute a sql query passing parameters fails with error
Oracle: Unable to invoke <serviceName>: Cannot invoke "com.thingworx.types.primitives.IPrimitiveType.getStringValue()" because the return value of "com.thignworx.types.collections.ValueCollection.getObject()" is null
or
Postgres: Unable to Invoke Service <serviceName> : Execute Query failed: org.postgresql.util.PSQLException: ERROR: operator does not exist: bigint = character varying Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts. Position: 46

SQL query is of type
select * 
from <<tablename>> 
where "myColumn" = [[columnValue]]

 
This is a printer-friendly version of Article 346927 and may be out of date. For the latest version click CS346927