Convert string dropdown to Integer for use in SP

Ok I have a form
2 dropdowns and a submit button

1st dropdown string
Machine1
Machine2
Machine3
Machine4

2nd Dropdown - retrieved from stored procedure
exec spGetMachineSchedule @MachineID = “{Root Container.MachineID.selectedLabel}”, @Option = ‘workorder’

Basically this dropdown fills in with scheduled workorders based on the selection of the 1st dropdown. data is received as Integer

Submit button:
MachID = event.source.parent.getComponent(‘MachineID’).selectedLabel
WOID = event.source.parent.getComponent(‘WorkOrder’).selectedLabel

call = system.db.createSProcCall(“spSetMachineWorkOrder”,“mdvsites”)
call.registerReturnParam(system.db.INTEGER)
call.registerInParam(1, system.db.VARCHAR, ‘MachID’)
call.registerInParam(2, system.db.INTEGER, ‘WOID’)
system.db.execSProcCall(call)

#Print the result to the console
print call.getReturnValue()

Result:
caused by Exception: Error executing system.db.execSProcCall()
caused by GatewayException: Error trying to coerce ‘WOID’ [String] to a class java.lang.Integer

Not sure what to do from here… I assume I would need to use “toInt” just not sure where…

Thanks for pointing me in the right direction.

First try removing the quotes from your variable names:

MachID = event.source.parent.getComponent('MachineID').selectedLabel
WOID = event.source.parent.getComponent('WorkOrder').selectedLabel

call = system.db.createSProcCall("spSetMachineWorkOrder","mdvsites")
call.registerReturnParam(system.db.INTEGER)
call.registerInParam(1, system.db.VARCHAR, MachID)  #<---------------  HERE
call.registerInParam(2, system.db.INTEGER, WOID)    #<--------------- AND HERE
system.db.execSProcCall(call)

#Print the result to the console
print call.getReturnValue()

If you need, use int in Python:

MachID = event.source.parent.getComponent('MachineID').selectedLabel
WOID = event.source.parent.getComponent('WorkOrder').selectedLabel

call = system.db.createSProcCall("spSetMachineWorkOrder","mdvsites")
call.registerReturnParam(system.db.INTEGER)
call.registerInParam(1, system.db.VARCHAR, MachID)  
call.registerInParam(2, system.db.INTEGER, int(WOID))    #<--------------- USE INT HERE
system.db.execSProcCall(call)

#Print the result to the console
print call.getReturnValue()

DOH!!!

Thanks adamaustin. removing quotes took care of it…