Cast variable in mapper into a specific datatype before insert or update into a database
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2018 01:11 AM
how to cast a variable in mapper to a specific datatype before inserting or updating it into a table?
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2018 06:55 AM
From what I have happened to see, I know this is possible to do in the mapper.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2018 09:46 AM
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.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2018 08:51 PM
I want to convert a mapper variable into a varchar2(100) datatype, is that possible on snaplogic?
