Problem with RunQuery and Retrieving Row Values

I’m trying to run a query inside a button ‘mouseClicked’ event. Below is the query I’m running with the results from SQL Management Studio. Also, I’ve attached a picture of the same query being run inside IGNITION. If I ask for the result at (0,0), I get the productname, but if I ask for the value at (0,1) or (0,2) then I get an error of 'can’t convert 0 to java.lang.String.


Any ideas on what I’m doing wrong? While I’m not new to programming, I am new to Python and Ignition.

It’s a data type issue. Convert to string and you’re set.

event.source.parent.getComponent("Result").text = str(result.getValueAt(0, 1))

Thank you very much! I was trying toString(), String(), and everything in between except for that.

You also do not need to use getValueAt on a resultset.
You can just do str(result[0][1])