Use flow variables with datatype long

I have a database query like “SELECT count(*) AS numberOfCols FROM …”. I put the result in a flow variable with the node “Table Row to Variable” because I would like to use the value of numberOfCols in the “Rule Engine Variable”. Now the variable has the datatype long and I can’t use it in the “Rule Engine Variable”. Does anyone can help me to change the datatype? Thanks a lot.

Dear @max_schmidt ,

I thought “this can’t be that hard” but then I saw that Long flow variables are invisible to almost all nodes, including Java Edit Variable (simple or normal), Variable Expressions and Math Formula (Variable) nodes.

Strangely enough, although a Long flow variable is invisible to a Math Formula (Variable) node, Variable Expressions and Java Edit Variables nodes, a Long column is not invisible to a regular Math Formula, Column Expressions, and Java Snippet nodes.

Could this be a bug in Knime?

So, to solve this problem, insert a (for example) Math Formula node before the Table Row to Variable node:

image

with the following config:

This is just one possible solution, Java Snippet and Column Expressions nodes would also work.

Best
Aswin

2 Likes

Sorry for the trouble here. Wider application of long flow variables is something we are aware of and working on. Thanks for your feedback (and patience!) :slight_smile:

2 Likes

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.