This is a solution I found that makes use of variables.
It seems that variables cannot be set and used on the same transformation, so we need to create a job that calls a transformation that sets variables, and from this point all other transformations can make use of the variables that have been set:
Set Variable Transformation
The Java Script step from my question does not generate any row, it just generates one more column on an existing set of rows, so it can't be the first step of a transformation, but we have to add one empty row with a "Generate Row" step:
my JavaScript code is still the same:
//Script here
var calculated_value = "Hello, this is some value!";
and to set my variable, I decidet to use the "Set Variables" step:
Execute SQL transformation
All transformations following the "Set Variable" transformation can now make use of variable substitution.
My SQL Script executes the query:
INSERT INTO my_table (column) VALUES ('${CALCULATED_VALUE}')
(please notice that I had to quote the variable, this could lead to SQL injections problems... but in my example it could be fine). I just had to set the "Variable substitution" flag and it works!
However, I'm still trying to make it work with parameters instead of variables.
Some reference can be found here: Using Variables in Kettle.