标签:let values from date length ike bsp sele upd
//声明
Declare p_tmpValue int DEFAULT null;
Declare p_tmpName LONGTEXT DEFAULT ‘ ‘;
//IF IN SET
IF (p_tmpTag in (‘A‘, ‘B‘))
THEN
SET p_tmpValue=1;
END IF;
//增:
INSERT test.tags(ID, tmpTag, tmpValue)
VALUES(p_Id, p_tmpTag, p_tmpValue);
//删:
DELETE FROM test.Devices
WHERE DeviceId = p_DeviceId
AND p_TagName like ‘%,‘ || TagName || ‘,%‘
//改:
UPDATE test.tags
SET DeviceName = p_DeviceName,
TagLength = p_TagLength
WHERE Id = p_Id;
//查:
SELECT DeviceSN, TagName
FROM test.devices
where TagId = p_Id
标签:let values from date length ike bsp sele upd
原文地址:https://www.cnblogs.com/embeddedking/p/9663521.html