--oracle
DECLARE
CNT PLS_INTEGER;
BEGIN
SELECT COUNT (*) FCOUNT
INTO CNT
FROM (SELECT 1
FROM LT_HS_AccountOpenCloseExt
WHERE (FACCTSYSID = 1 AND FSTOCKORGNO = 1) AND ROWNUM <= 1);
IF CNT = 0
THEN
EXECUTE IMMEDIATE
'INSERT INTO LT_HS_AccountOpenCloseExt VALUES (1, 1, 1,''2015-06-28 02:03:0'', ''1'')';
ELSE
EXECUTE IMMEDIATE
'UPDATE LT_HS_AccountOpenCloseExt SET FUSER = 2, FOPERATESTART =''2015-06-28 02:03:0'', FOPERATEEND =''1'' WHERE (FACCTSYSID = 1 AND FSTOCKORGNO = 1)';
END IF;
END;
--sql server IF NOT EXISTS (SELECT 1 FROM LT_HS_AccountOpenCloseExt WHERE (FACCTSYSID = 1 AND FSTOCKORGNO = 1)) BEGIN INSERT INTO LT_HS_AccountOpenCloseExt VALUES (1, 1, 1, '1', '1') END ELSE BEGIN UPDATE LT_HS_AccountOpenCloseExt SET FUSER = 1, FOPERATESTART = '1', FOPERATEEND = '1' WHERE (FACCTSYSID = 1 AND FSTOCKORGNO = 1) END;
转载于:https://www.cnblogs.com/liuyudong0825/p/6544238.html
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/36311.html