Type conversion while querying from DB

Certified Senior Developer

Hello All,

Is there any way we can convert a datatype of column while querying from DB using query entity?

Thank you in advance.

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    I don't know if you could try to cast the result of the query as a similar CDT with the same fields but sometimes a different datatype for a given field, and that could be within the same rule as the QE.  You could save the .data of the query result into a rule input whose type is a similar CDT.  It won't work with a local variable because they take on the type of whatever you put in them.  It's possible that implicit casting would take over.  If it works, this is probably the simplest approach outside of synched records, which you should definitely check out if you can.

    Aside from that, no, you get the data as step one, and then convert it as needed as step two.

Reply
  • 0
    Certified Lead Developer

    I don't know if you could try to cast the result of the query as a similar CDT with the same fields but sometimes a different datatype for a given field, and that could be within the same rule as the QE.  You could save the .data of the query result into a rule input whose type is a similar CDT.  It won't work with a local variable because they take on the type of whatever you put in them.  It's possible that implicit casting would take over.  If it works, this is probably the simplest approach outside of synched records, which you should definitely check out if you can.

    Aside from that, no, you get the data as step one, and then convert it as needed as step two.

Children
No Data