salix/db/routines/vn/procedures/ledger_next.sql

11 lines
281 B
MySQL
Raw Normal View History

DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ledger_next`(OUT vNewBookEntry INT)
BEGIN
UPDATE ledgerCompany
SET bookEntry = LAST_INSERT_ID(bookEntry + 1)
WHERE fiscalYear = vFiscalYear;
SET vNewBookEntry = LAST_INSERT_ID();
END$$
DELIMITER ;