Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi, i need to store the result returned by an sql query into a variable. Based on the value of the Variable further flow will be decided. How to do so?
Current job flow is:
TBufferInput >>> tFlowToIterate >>> tOracleInput >>> tJava
Query in tOracleInput = Select count(*) from EMP where EMP.id = somenumber
i want to get the result , and if result > 1 do something else something else.
Thanks in advance.
@tanvi_patil,you can store the result into global variable using tSetGlobalvar and using get (String)globalMap.get() method you can get.
how ? can u show me the flow of how to store. On which flow can i get the output.
tOracleInput >>>> tSetGlobalVarible ?
@tanvi_patil,please find below.since from tOracleInput you should get only one column.that is count.
@manodwhb can u show me the schema and settings of tOracleInput , i don't get the varibale count. I get error saying count cannot bge resolved to a field.
my query: "Select count(*) from TEST where TEST.ID="+ ((String)globalMap.get("myKey"))
I have 3 columns in my schemna id, col1, col2
@tanvi_patil,when you used below query in tOracleinput shema you should get only one coumn.
"Select count(*) as count from TEST where TEST.ID="+ ((String)globalMap.get("myKey"))
hi, @manodwhb , when i access the variable by get and display, it gives null
@tanvi_patil,can you show me where you were dispaying variable in job?
@manodwhb in tjava for debugging purposes.
I actually need the value of variable for making decision ,, i.e if >0 something etc
System.out.println("count variable"+ ((String)globalMap.get("count")) );