fpmi.db.ScalarQuery with varibales

I need to return a value using a scalar query, here is an example of what I’m trying to do:

zo = 10
pt = 4366
Pclass = event.source.parent.getComponent(‘product class’).text
#Pclass is set to ‘class_2’, which is a column name in table catalog1

Rate = fpmi.db.runScalarQuery(“SELECT ‘%s’ FROM employee WHERE id = ‘%s’” % (Pclass, zo), ‘manufacturing’)

Instead of returning the value stored in column class_2 which is 0.05, Rate is set to the value of ‘class_2’

Any ideas?

I think you just have too many quotes, try this:

Rate = fpmi.db.runScalarQuery("SELECT %s FROM employee WHERE id = '%s'" % (Pclass, zo), 'manufacturing')