15 lines
290 B
MySQL
15 lines
290 B
MySQL
|
DELIMITER $$
|
||
|
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `edi`.`putOrder_BEFORE_INSERT`
|
||
|
BEFORE INSERT ON `putOrder`
|
||
|
FOR EACH ROW
|
||
|
BEGIN
|
||
|
|
||
|
DECLARE nextID INT;
|
||
|
|
||
|
SELECT 1 + MAX(id) INTO nextID FROM putOrder ;
|
||
|
|
||
|
SET NEW.orderTradelineItemID = nextID;
|
||
|
|
||
|
END$$
|
||
|
DELIMITER ;
|