Problem with system.db.runquery

Hello,
I’m trying to make a script system.db.runquery. This is my code:

table = system.db.runQuery("SELECT * FROM adm_supplier","dscada_main") value= 'test' for row in table: if(value == row["ID_SUPPLIER"]): print 'ok' else: print 'no'

The output is this:
no
ok
no
no

The output is correct because I have one line that is ‘test’ while others no.
I want that when the value is present in a row I return ‘ok’, otherwise ‘no’.
It now returns all four lines, but I want you back only a line saying ‘ok’ if it exists, otherwise ‘no’
How can I fix?

Thanks

Here you go:

table = system.db.runQuery("SELECT * FROM adm_supplier","dscada_main")
if 'test' in [row["ID_SUPPLIER"] for row in table]:
	print 'ok'
else:
	print 'no'

Best,

Thank you so much!

Andrea