Script I am trying to use when a mouse is clicked. It gives me a mismatched syntaxerror. Any ideas?
SELECT * FROM MobileWorkOrder
WHERE Equipment = ‘{event.source.parent.getComponent(‘Dropdown’).selectedLabel}’
Script I am trying to use when a mouse is clicked. It gives me a mismatched syntaxerror. Any ideas?
SELECT * FROM MobileWorkOrder
WHERE Equipment = ‘{event.source.parent.getComponent(‘Dropdown’).selectedLabel}’
Try a printing the query statement to the console. For example, print query. This will help us understand the behavior of the dropdown and mouse click event.
This is what it says
File “”, line 1
SELECT * FROM MobileWorkOrder
^
SyntaxError: mismatched input ‘MobileWorkOrder’ expecting NEWLINE
disregard last one
File "", line 1
SELECT * FROM MobileWorkOrder
^
SyntaxError: mismatched input 'MobileWorkOrder' expecting NEWLINE
it would add the
You’re trying to use SQL where python (jython) is expected. You need to construct your SQL in a string and submit it with one of the system.db.* script functions.
I didn’t realize that until I went about it a different way. It works now. How do yo know when you need to use python and when you need to use sql. I am new to the scripting side of things.
If it’s scripting, it’s python. If it’s a query, it’s SQL.
ok, thanks for the help