MySQL Forums
Forum List  »  Stored Procedures

Re: stored procedure truncating
Posted by: Peter Brawley
Date: April 20, 2018 11:46AM

drop procedure if exists t;
delimiter go
create procedure t()
begin
  UPDATE joblisttable 
  INNER JOIN joblistfromdevice 
  ON joblisttable.jobnumber=joblistfromdevice.jobnumber 
  SET joblisttable.jobstart= joblistfromdevice.jobstart; 

  DELETE joblistfromdevice 
  FROM joblistfromdevice 
  INNER JOIN joblisttable ON joblisttable.jobnumber=joblistfromdevice.jobnumber; 
end;
go
delimiter ;
show create procedure t\G
*************************** 1. row ***************************
           Procedure: t
            sql_mode: NO_ENGINE_SUBSTITUTION
    Create Procedure: CREATE DEFINER=`pietari`@`%` PROCEDURE `t`()
begin
  UPDATE joblisttable
  INNER JOIN joblistfromdevice
  ON joblisttable.jobnumber=joblistfromdevice.jobnumber
  SET joblisttable.jobstart= joblistfromdevice.jobstart;

  DELETE joblistfromdevice
  FROM joblistfromdevice
  INNER JOIN joblisttable ON joblisttable.jobnumber=joblistfromdevice.jobnumber;
end
character_set_client: utf8mb4
collation_connection: utf8mb4_general_ci
  Database Collation: utf8_general_ci

Options: ReplyQuote


Subject
Views
Written By
Posted
748
April 20, 2018 10:44AM
Re: stored procedure truncating
570
April 20, 2018 11:46AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.