Hello all,
I am new to KNIME. I am trying to write a query from the output of a new column generated by String Manipulation. I am using DB Table selector to write my queries. Can anyone help me what can be connected to the output of String Manipulation node so that I can reference that table to write a new query?
Hi @uix14972 and welcome to the Knime Community.
Can you show us what you have done so far? A screenshot of your workflow would be a good start.
So I am trying to use data from the new column that I generated using string manipulation to be used as a variable in Db table selector. I am afraid I may not be able to share the data here since it is company infoâŚwould you be able to explain what can be done with this half piece of info that I gave you? Am I using the right node?
Hi @uix14972 , we understand about the privacy of the data, no worries.
If I understand correctly, you are trying to integrate values from a column from the results of the String Manipulation into your queries, is that correct? Which part of the queries do you want to integrate them? If itâs in the WHERE statement, you may want to look into the Parameterized DB Query Reader instead:
You wonât even need a Loop here, just connect the String Manipulation to the Parameterized DB Query Reader, and it will apply each row automatically.
Yes, I want to integrate values from a column generated from the results of the string manipulation into queries. Having said that, I will be writing a completely new query using those valuesâŚI will not be integrating the new values generated by string manipulation into my existing query. The new column name is âPart NumberââŚI will be joining that part number column with another column from a different DB table.
I tried using this statement : WHERE T5.âPART_NUMâ (+)=$${SPart Number}$$
but I am unable to fetch the data
Hello @uix14972,
and welcome to KNIME Community!
I see what you are doing and not sure will that work. One way to see database query you are sending to your database is to open output from DB Table Selector node and go to DB Query tab. But that is only possible if you execute it successfully. Can you do that with your syntax or not?
Br,
Ivan
Hi @uix14972
i assume in your database the column âT5â has a numeric data type and you try to adapt a string type as criteria.
BR
Hi @uix14972,
i forgot to mention. If your data column and your criteria are string types then you have to handle it within single quotations.
e.g. WHERE T5.âPART_NUMâ = â$${SPart Number}$$â
Please check both. Further if you move over the exclamation mark you should see the error message which of the SQL.
Another hint if you use the DB Query Reader you only need one node. The only difference in the SQL statement that the DB Table Selecter use the placeholder â#table#â and the in the DB Query Reader you have to enter [SCHEMA].[TABLE_NAME] instead of the placeholder.
I personally prefer the DB Query Reader because i can run much more complex SQL statements.
BR
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.