英文:
How do i store the results from an db(oracle) query as a global variable to be used in a RUN-IF condition in talend?
问题
I have a dbinput component where i am using an select statement as below:
"select file_name,file_size from dat_file where file_name = '"+(String)globalMap.get("tFileList_1_CURRENT_FILE")+"' order by file_name desc
"
I want to capture the value of file_name
and file_size
into global variables and i can use a RUNIF condition to validate if the filename and size are same from the filelist_1
folder as in db-IGNORE
only if filename and size are different-Then continue with the rest of the PROCESSING in talend.
Btw,i am getting the file size from tfileproperties component and checking if they are the same in database and the local file folder/dir ,and only if it DIFFERS-continue processing!
英文:
I have a dbinput component where i am using an select statement as below:
"select file_name,file_size from dat_file where file_name = '"+(String)globalMap.get("tFileList_1_CURRENT_FILE")+"' order by file_name desc
"
I want to capture the value of file_name
and file_size
into global variables and i can use a RUNIF condition to validate if the filename and size are same from the filelist_1
folder as in db-IGNORE
only if filename and size are different-Then continue with the rest of the PROCESSING in talend.
Btw,i am getting the file size from tfileproperties component and checking if they are the same in database and the local file folder/dir ,and only if it DIFFERS-continue processing!
答案1
得分: 1
你的查询正在将tFileList中的FileName与数据库中的FileName进行比较。为了实现你的目标,我认为你还应该在这个查询中比较FileSize。然后,你可以在一个RUNIF条件中检查tDBInput中的行数(使用全局变量tDBInput_2_NB_LINE)。如果为0,则表示没有匹配,你可以继续进行进程。
英文:
Your query is comparing FileName from tFileList with FileName from your DB. To achieve what you want, I think you should also compare FileSize in this query. Then you can check in a RUNIF condition the number of lines in your tDBInput (using global variable tDBInput_2_NB_LINE) If 0 then you don't have a match and you can continue the process
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论