Query Database smart service throwing error

Certified Senior Developer

Query Database smart service in process model showing exception "There was a problem executing the SQL query. SQL Message : [Ljava.lang.String; cannot be cast to java.lang.String".

My query was: "UPDATE Orders SET updateDate = now() WHERE orderId=ac!orderId"
ac!orderId is a "multiple" type node variable.

Can anyone help me on this?

  Discussion posts and replies are publicly visible

Parents
  • Hi Sudip,

    As mentioned above, Query Database has been deprecated. May I suggest you to use write to datastore entity instead.
    Since your order id is of multiple type, make your cdt as multiple. If your order id is not the primary key, you have to fetch the existing data to get the primary key. Once your cdt is built, pass the cdt with the updated values in the Write to datastore entity. Since the primary key in the cdt is already present, the system will update those rows only. While doing that, make sure the rest of the columns are not updated as that is a common mistake. Let me know if you have any further queries.
Reply
  • Hi Sudip,

    As mentioned above, Query Database has been deprecated. May I suggest you to use write to datastore entity instead.
    Since your order id is of multiple type, make your cdt as multiple. If your order id is not the primary key, you have to fetch the existing data to get the primary key. Once your cdt is built, pass the cdt with the updated values in the Write to datastore entity. Since the primary key in the cdt is already present, the system will update those rows only. While doing that, make sure the rest of the columns are not updated as that is a common mistake. Let me know if you have any further queries.
Children
No Data