Escape $ dollar sign in schema name of Parameterized DB Query node

I’m trying to use the “Parameterized DB Query” node, but the SQL I need to run references a schema which includes a $ in the name, “C$SCHEMA”. Knime interprets this as a variable reference. Is there any way to escape this and get it to read it as “C$SCHEMA”?

Hi @kuenzifr , the Parameterized DB Query usually does not reference to table or schema, but rather to columns in WHERE conditions/statements.

You need to use a DB Table Selector before you can use the Parameterized DB Query, and in the DB Table Selector, whatever you pass in the text box is read as string:
image

Now, I’m not saying that you can’t reference a table or schema in the Parameterized DB Query Reader, but what I mentioned above is the most common usage.

If you do need to reference the schema, it should not be a problem referencing to C$SCHEMA. Knime should not read it as a variable, as it’s not exactly the format of a variable reference. A variable reference usually looks like this: $${Svariable_name}$$ where the S represents the type of the variable, in this case S is for String. As you can see, C$SCHEMA looks nowhere close to that format.

EDIT: One question about this though… Who the heck creates a schema name with $ in it???

2 Likes

I configured the DB Table selector node, but in the Parameterized DB Query I still get the error message indicating that Knime is trying to interpret the schema name as a variable. This is even with it enclosed in double quotes.

By connecting the flow variables to the DB Table Selector node, I was able to do exactly the same as what I was trying to do with the Parameterized DB Query. I’m now not sure what the function of the latter is. I was put off doing anything in the DB Table Selector because it looked like it was bringing back the entire contents of the selected tables, which I definitely did not want to do. I wish the documentation of these nodes was a bit clearer and more complete.

2 Likes

Hi @kuenzifr , the DB Table Selector does not “bring back” any data. It only reference to a table or to a query (in case of Custom query).

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