I’m inserting rows into a db table with a button, but first I run a NamedQuery that returns a list of current values in the db table. If the new insert matches one currently in the db, instead of inserting new rows, it updates the current row’s qty.
So the shortened code I’m using is this:
query = system.db.runNamedQuery('DuplicateChecker', vars)
duplicates = system.dataset.toPyDataSet(query)
style = row['STYLE'] + ' ' + size + material
if style not in duplicates:
print 'Style is not currently in the database'
I put in some debugging code and verified that the duplicates datset is equal to
[0021910KP 5x5RB, 0F94-22KP 5x5RB]
and the style to check by is equal to
0021910KP 5x5RB
this obviously is in the dataset, so why does it print
Style is not currently in the database