I'm using Kettle for a transformation and hitting this same issue trying to get a value for an integer based 'out' parameter in mysql, (the field should actually be bigint
but I don't think it's supported in Kettle).
I've implemented the workaround for this exact issue with decimal but I'm having a hell of a time trying to get the value firstly back into the id field (not id_1
), and secondly to convert it back to an integer so it can be inserted into the database.
This is the relevant flow:
This is the step definition:
On the inbound stream coming out of lookup existing id
there is already a field added called id
which is a decimal that may be either a value, or null. If it's null it triggers this db procedure lookup at the filter rows
step, so in other words, it will always be null at the db procedure
step (and hence I can't use an in-out parameter here).
So what I want to happen is when it leaves the db procedure
step, id
should be populated with the value of the out parameter (ideally it would be an integer, but I can live with decimal because of the bug). But instead I get id_1
inserted into the stream.
Then further down the line, assuming I have the value in id field as a decimal, I then need to convert that back to an Integer so it can be inserted into the database without error. I don't really know how to write the javascript in Kettle though and I can't find the documentation on the language.
So my questions are twofold:
- Can I make the db procedure insert
id
back into the stream? - How would I write a script(or use a step) that transforms the
id
(orid_1
) into an Integer and places it back into theid
field in the stream?