attach is a sample of code I am testing. I am getting an error with the use of the SWITCH command. So what did I forget in the switch command?
The first line checks to see if the value which is an integer is greater than zero. if it is then it should pull up the current machine number that that employee is assigned and also the employee designator. Then it checks to make sure the old assigned machine is greater than zero. If so then it will use the employee designator which should be a capital O or H. If it is a capitol O then I want it to be equal to assigned_operator, and H would be assigned_assist1. The it will do an update query where it would use the now converted (using the switch command) transact. However everytime it comes to this switch command I get an error message, either being illegal or improper format. Any assistance greatly appreciate.
if ass_op>0:
old_mach = fpmi.db.runScalarQuery(“SELECT mach_num FROM Show_All_Employees_ACTIVE_INACTIVE WHERE ProdEmployeeID = %s”%ass_op,“mocrosoft”)
old_desc = fpmi.db.runScalarQuery(“SELECT [function] FROM Show_All_Employees_ACTIVE_INACTIVE WHERE ProdEmployeeID = %s”%ass_op,“mocrosoft”)
if (old_mach >= 0):
switch(old_desc,‘O’,‘H’,‘assigned_operator’,‘assigned_assist1’,’’)
fpmi.gui.messageBox("%s"%old_desc)
fpmi.db.runUpdateQuery(“UPDATE interim SET assigned_operator = 0 WHERE mach_num = %s”%old_mach,“mocrosoft”)