Forum Discussion
Hey @rajendraj
Why do you map(x => parseInt(x)) when you don’t need to. Simply go with join(“,”). Next, when you obtain the output you shouldn’t have something like ‘(403,412,414)’ but just without the single quotes, i.e. (403,412,414).
Actually the single quotes are erroring out.
I made a test pipeline for updating in Postgres, which you can take a look:
PostgreSQL update example_2020_07_06.slp (4.8 KB)
BR, Igor Micev
Hi @fmdf, depending on the destination if it’s another db usually it could take care of it without the conversion but if it’s to excel then I would try using an execute snap and converting it within the execute snap or if that’s not an option maybe look into the match data type option in the select snap maybe.
- bojanvelevski5 years agoValued Contributor
Hi @fmdf ,
I can think of two solutions:
- You can cast the value while reading in your query => SELECT CAST(
field
AS int) - Use a Mapper with a ternary operator within SnapLogic => $field == ‘true’ ? 1 : 0
Regards,
BojanThank you for the suggestions.
I am doing the mapper solution now.
Why should I have to cast a field as int when it is already a bit and therefore not string?
I don’t really want to do either of these options but it seems I have no choice.
I just want them to stop converting my bit data to a string. If they can’t handle bit, at least automate it to int instead of a string.
It creates extra work for me with the “no code” solution (rolling eyes).
- You can cast the value while reading in your query => SELECT CAST(