Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
_AnonymousUser
Specialist III
Specialist III

[resolved] pass tfileproperties schema to tmysqlinput

hi

how to pass tfileproperties schema value
dirname
size
md5
to tmysqlinput query
the flow is like as below
tfilelist----->iterate---->tfileproperties------>iterate------>tmysqlinput------>if--true---->tfilecopy
in query i want to give like this
select 1 from table_size where filename='"+((String)globalMap.get("tFileList_1_CURRENT_FILE"))+"' and size= ;
for size i want tfileproperties size value to be passed. how to achieve it ???

And also how to pass this value "1" in query to a variable of tmysqlinput ,just giving a variable in the schema serve the purpose??
Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Hi,
For infinite loop
You can design a job like that:
tInfiniteLoop (set some time) --------> tIterateToFlow --------> tRunJob
In your subjob(trunjob), put your workflow into
tfilelist---->iterate--->tfileproperties----->row(main)---->tflowtoiterate--->iterate--->tmysqlinput---->tflowtoiterate------>if---->tfilecopy
Even if your subjob (tRunJob) fails, it will loop back, hold on for a few seconds and re -run your job again.
That means you should create 2 separate jobs. One job for the tmysqlinput workflow and trigger of tfilecopy and the other one aim at loop.
Does it satisfy your requirement?
Best regards
Sabrina

View solution in original post

9 Replies
Anonymous
Not applicable

Hi,
If I understand you well, the query should be:
"select 1 from table_size where filename='"+((String)globalMap.get("tFileList_1_CURRENT_FILE"))+"' and size="+row.size
Where is your value 1 come from? It is fixed or dynamic?
Best regards
Sabrina
_AnonymousUser
Specialist III
Specialist III
Author

hi

the value one is fixed here ,the logic is this if select query has value for file name and size passed i shud get one else no value so . The row.size will it give tfileproperties size value ??
Anonymous
Not applicable

Hi,

The row.size will it give tfileproperties size value ??


To make it clear, I have designed a demo job.
tfilelist-->iterate-->tfileproperties-->main-->tflowtoiterate-->tmysqlinput-->tlogrow
See my screenshots.
Is it what you are looking for?
Best regards
Sabrina
0683p000009MBeE.png0683p000009MBeJ.png0683p000009MBeO.png

_AnonymousUser
Specialist III
Specialist III
Author

the row.size is not working and if i want to use if trigger condition for that value "one" returned from select query how to specify in java code in if condition code part . how to do it ??
Anonymous
Not applicable

Hi,
What's your expected result from tmysqlinput? And your condition(Run if.....)?It seems you want to trigger a subjob(tfilecopy) if there is a result returned(value one)?
For example:
I want to trigger the subjob if there is a/no processed row in workflow
Set the condition of RunIf:
!((Integer)globalMap.get("tMysqlInput_1_NB_LINE"))==0 or ((Integer)globalMap.get("tMysqlInput_1_NB_LINE"))==0

Could you give us more info about your current job and paste your job design screenshots into forum. There may be better solution for your case.
Best regards
Sabrina
_AnonymousUser
Specialist III
Specialist III
Author

hi sabrina

thank you for the reply i used what u said in if condition its working fine 0683p000009MACn.png
i changed the job as follows

twaitforfile--->iterate--->tfilelist---->iterate--->tfileproperties----->row(main)---->tflowtoiterate--->iterate--->tmysqlinput---->tflowtoiterate------>if---->tfilecopy

this is the query in tmysqlinput
select 1 from ETL_SIZE where filename='"+((String)globalMap.get("tFileList_1_CURRENT_FILE"))+"' and size="+row2.size
in if condition
((Integer)globalMap.get("tMysqlInput_1_NB_LINE"))==1

its working fine but i want to run the job in infinite loop, if i connect tinfiniteloop to twaitforfile will it work or is it correct ??
Anonymous
Not applicable

Hi,
For infinite loop
You can design a job like that:
tInfiniteLoop (set some time) --------> tIterateToFlow --------> tRunJob
In your subjob(trunjob), put your workflow into
tfilelist---->iterate--->tfileproperties----->row(main)---->tflowtoiterate--->iterate--->tmysqlinput---->tflowtoiterate------>if---->tfilecopy
Even if your subjob (tRunJob) fails, it will loop back, hold on for a few seconds and re -run your job again.
That means you should create 2 separate jobs. One job for the tmysqlinput workflow and trigger of tfilecopy and the other one aim at loop.
Does it satisfy your requirement?
Best regards
Sabrina
_AnonymousUser
Specialist III
Specialist III
Author

hi

yes , thank you sabrina for your suggestion
Anonymous
Not applicable

Hi,
Don't hesitate to post your issue on forum.
Best regards
Sabrina