SQL Select Scripting Question

What is the syntax in the select statement to allow the query to check for Product_ID = the value of the Totalscan variable and not look for the text “Totalscan”

###Convert scanner bar code bytes to ASCII and combine into a single string
Totalscan = unichr(w3b1)+ unichr(w3b2) + unichr(w4b1) + unichr(w4b2) + unichr(w5b1) + unichr(w5b2) + unichr(w6b1) + unichr(w6b2)

myvalue = system.db.runScalarQuery(“select Rectifier_1_Voltage from Rectifier_Settings where Product_ID = Totalscan”)

java.lang.Exception: java.lang.Exception: Error executing system.db.runScalarQuery(select Rectifier_1_Voltage from Rectifier_Settings where Product_ID = Totalscan, MyDB, , )

myvalue = system.db.runScalarQuery("select Rectifier_1_Voltage from Rectifier_Settings where Product_ID = '%s'"%Totalscan)

Worked perfectly!