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

Announcements
Talend Cloud AWS EU Scheduled Outage: Starting Tues 26 May 21:00 CEST with expected completion Wed 27 May 01:00 CEST
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Result of tOracleInput

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.

Labels (3)
1 Solution

Accepted Solutions
manodwhb
Champion II
Champion II

@tanvi_patil,please the check the follwing,i have used in tJava to dispaly the variable.

 

0683p000009Lx4W.png0683p000009Lwib.png

View solution in original post

11 Replies
manodwhb
Champion II
Champion II

@tanvi_patil,you can store the result into global variable using tSetGlobalvar and using get (String)globalMap.get() method you can get.

Anonymous
Not applicable
Author

how ? can u show me the flow of how to store. On which flow can i get the output. 

tOracleInput >>>> tSetGlobalVarible ? 

manodwhb
Champion II
Champion II

@tanvi_patil,please find below.since from tOracleInput you should get only one column.that is count.

0683p000009LwAk.png

Anonymous
Not applicable
Author

@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

 

 

manodwhb
Champion II
Champion II

@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"))  

 

0683p000009Lx4R.png

Anonymous
Not applicable
Author

hi, @manodwhb ,  when i access the variable by get and display, it gives null

manodwhb
Champion II
Champion II

@tanvi_patil,can you show me where you were dispaying variable in job?

Anonymous
Not applicable
Author

@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")) );
manodwhb
Champion II
Champion II

@tanvi_patil,please the check the follwing,i have used in tJava to dispaly the variable.

 

0683p000009Lx4W.png0683p000009Lwib.png