update_device.sql 534 B

12345678910111213
  1. -- drop PROCEDURE if exists `update_device`;
  2. CREATE DEFINER = `eq`@`` PROCEDURE `eq`.`update_device`(
  3. IN empIdIN int(10),
  4. IN deviceIdIN varchar(50)
  5. ) SQL SECURITY INVOKER BEGIN
  6. DECLARE empids,
  7. isvideo int(10);
  8. select empId into empids from device_information where deviceId = deviceIdIN;
  9. update `user` set device = 0,deviceId='' where empId = empids;
  10. update `user` set device = 1 ,deviceId=deviceIdIN where empId = empIdIN;
  11. update device_information set empId = empIdIN where deviceId = deviceIdIN;
  12. END