首页  ·  知识 ·  生产制造
Form_Success判断form有没有错误
网友    ERP  编辑:dezai   图片来源:网络
FORM_SUCCESS should not be used to test whether a COMMIT_FORM or POST built-in h

Note: 
FORM_SUCCESS should not be used to test whether a COMMIT_FORM or POST built-in has succeeded. 
Because COMMIT_FORM may cause many other triggers to fire, when you evaluate FORM_SUCCESS it may not reflect the status of COMMIT_FORM but of some other, more recently executed built-in. 
A more accurate technique is to check that the SYSTEM.FORM_STATUS variable is set to 'QUERY' after the operation is done.
用form_success判断form是否没有错误,在某些时候是不能完全检测到form的错误。
比较正确的做法是对system.form_status是否是query进行判断。

IF Form_Success THEN
    Commit;
    IF :System.Form_Status <> 'QUERY' THEN
      Message('Error prevented Commit');
      RAISE Form_Trigger_Failure;
    END IF;
END IF;

有时候看情况是否要增加SQLCODE的判断
IF form_success or SQLCODE = 0 THEN

本文作者:网友 来源:网络
CIO之家 www.ciozj.com 微信公众号:imciow
    >>频道首页  >>网站首页   纠错  >>投诉
版权声明:CIO之家尊重行业规范,每篇文章都注明有明确的作者和来源;CIO之家的原创文章,请转载时务必注明文章作者和来源;
延伸阅读
也许感兴趣的
我们推荐的
主题最新
看看其它的