Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
fjblau
Contributor
Contributor

Use JSON field in SQL Query

I have a field in my json that lists machine names.... I am able to extract that and it gives me the right values. I iterate on that output with

JSON ---Row2---> FlowToIterate -> DBinput - tLogRow

in the dbInput SQL Query I have:

"SELECT inspectionMachineName,

lastPrId

FROM inspectionMachine

where inspectionMachineName = "+(String)globalMap.get(\"row2.DbName\")

But I cannot get it to run and display the data from inspectionMachine table.

Any ideas?

Labels (2)
1 Reply
Anonymous
Not applicable

Hi

Before using the global variable in the query, print the value of (String)globalMap.get("row2.DbName") on a tJava to check whether it has the right value.

JSON ---Row2---> FlowToIterate -> tJava

 

on tJava:

System.out.println((String)globalMap.get("row2.DbName"));

 

Regards

Shong