Select query

Does this look like a good way to restrict multiple instances of a value (store) from appearing in my table.
This is from my table binding script.
This is the line in question

if system.db.runSelectQuery(“SELECT store FROM shipping_stores”, ‘Sample’) like valueMod:
#idNumber = system.db.runScalarQuery(“SELECT MAX(store) + 1 FROM shipping_stores”)
system.db.runUpdateQuery(“INSERT INTO shipping_stores (store) VALUES (’%s’)” % (valueMod), ‘Sample’)
else:
system.db.runUpdateQuery(“UPDATE shipping_stores SET groupname = ‘%s’ WHERE store = ‘%s’”% (value1, valueMod), ‘Sample’)
system.db.runUpdateQuery(“UPDATE shipping_stores SET modename = ‘%s’ WHERE store = ‘%s’”% (value2, valueMod), ‘Sample’)

EDIT:
Solved.
Used prepupdate query

results = system.db.runPrepQuery(“SELECT * FROM shipping_stores WHERE store LIKE ?”, [valueMod], ‘Sample’)
if results< 1:
#idNumber = system.db.runScalarQuery(“SELECT MAX(store) + 1 FROM shipping_stores”)
system.db.runUpdateQuery(“INSERT INTO shipping_stores (store) VALUES (’%s’)” % (valueMod), ‘Sample’)
system.db.runUpdateQuery(“UPDATE shipping_stores SET groupname = ‘%s’ WHERE store = ‘%s’”% (value1, valueMod), ‘Sample’)
system.db.runUpdateQuery(“UPDATE shipping_stores SET modename = ‘%s’ WHERE store = ‘%s’”% (value2, valueMod), ‘Sample’)

This is what I came up with but I want to say if there isn’t anything in the dataset (results) then insert…
I cant seem to use an appropriate not statement.
Any ideas?

Calling len() on the dataset will return how many rows are in the dataset. If your select statement was called on an empty table, then the dataset would have zero rows. The condition check for “if there’s nothing in the dataset” would be:

if len(results) == 0:

thanks