英文:
How to capture the output after querying the tdbrow in talend and display it?
问题
我正在从tfilelist中提取文件名,并且我正在与数据库进行检查,看看该文件名是否存在于表中,并显示相应的输出?
当我在tbdrow/tbinput之后尝试使用tlogrow和tjavarow组件后,我看不到输出。
不确定我漏掉了什么,我还想存储文件名,并在存在时进行检查,打印诸如“文件存在”的消息,我如何在显示输出后执行IF条件?
我只是从tbdinput迭代到tbdrow,以找出哪个效果最好,我觉得这是多余的,因为这两个组件都可以用于查询数据库并返回结果?哪个更好用,即使是为了更快的结果?
Tlogrow2和3仍然显示空值,即使tlogrow显示了文件名,如何将数据库查询结果打印到控制台,并在此之后执行filexists检查?请帮忙解决。
英文:
I am extracting the filename from tfilelist and i am checking against the database if that filename exists in the table and display the corresponding output?
I cannot see the output when i tried with both tlogrow and tjavarow component after tbdrow/tbinput.
Not sure what i am missing,and also i would want to store the filename and do a check if it exists print a message such as "file exists" and how do i do the IF condition after displaying the output?
I am just iterating from tbdinput to tbdrow to see which one works best,i feel its redundant since both the components can be used to query the db and return the results?Which one is better to use even though for faster results?
Tlogrow2&3 still displaying null value even though tlogrow shows the filename ,how to print the results from the database query onto the console and perform filexists check after that?please help
答案1
得分: 3
使用 globalMap
获取值:
System.out.println("Query is: " + ((String)globalMap.get("tDBInput_1_QUERY")))
由于某种原因,在获取值时总是需要使用 2 个开括号和闭括号。另外,如果你已经重新命名了组件,仍然需要使用 Talend 在将其添加到作业时分配的名称,例如:tDBInput_x
。
英文:
Use globalMap
to get the value:
System.out.println("Query is: " + ((String)globalMap.get("tDBInput_1_QUERY")))
For some reason, you always have to use 2 opening and closing parentheses when getting the value. Also, if you have renamed your component, you still need to use the name that Talend assigns it when you add it to your job, IE: tDBInput_x
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论