16 lines
380 B
SQL
16 lines
380 B
SQL
DELIMITER $$
|
|
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`clientRisk_update`(vClientId INT, vCompanyId INT, vAmount DECIMAL(10,2))
|
|
BEGIN
|
|
IF vAmount IS NOT NULL
|
|
THEN
|
|
INSERT INTO clientRisk
|
|
SET
|
|
clientFk = vClientId,
|
|
companyFk = vCompanyId,
|
|
amount = vAmount
|
|
ON DUPLICATE KEY UPDATE
|
|
amount = amount + VALUES(amount);
|
|
END IF;
|
|
END$$
|
|
DELIMITER ;
|