Forum Discussion

SuhasPothedar's avatar
SuhasPothedar
New Contributor II
8 years ago

Cast variable in mapper into a specific datatype before insert or update into a database

how to cast a variable in mapper to a specific datatype before inserting or updating it into a table?

3 Replies

  • tstack's avatar
    tstack
    Former Employee

    What are the source and destination types you are looking to convert? Here are some conversions that are available:

    • parseFloat()/parseInt() - Convert a string into a number
    • Date.parse() - Convert a string to a date
    • To convert a value (other than null) to a string, you can call the ‘.toString()’ method on the object.
    • JSON.stringify() - Converts a value to JSON.
    • SuhasPothedar's avatar
      SuhasPothedar
      New Contributor II

      I want to convert a mapper variable into a varchar2(100) datatype, is that possible on snaplogic?