cancel
Showing results for 
Search instead for 
Did you mean: 

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

SuhasPothedar
New Contributor II

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

3 REPLIES 3

stephenknilans
Contributor

From what I have happened to see, I know this is possible to do in the mapper.

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.

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