如何在Firebird程序中处理用户定义的异常?

时间:2016-06-01 16:43:31

标签: exception exception-handling firebird firebird2.5

我创建了异常:

$("#price-slider").slider({ range: true, animate: true, min: 1000, max: 500000, values: [1000, 500000], create: function(event, ui) { valtooltip($(this), ui); }, slide: function(event, ui) { valtooltip($(this), ui); $("#amountx").val("" + ui.values[0] + "-" + ui.values[1]); if((ui.values[0] == 1000) && (ui.values[1] == 500000)){ $("#amountx").hide(); }else{ $("#amountx").show(); } }, stop: function(event, ui) { valtooltip($(this), ui); $("#amountx").focus(); } });

然后在程序中调用它

CREATE EXCEPTION E_NO_CLIENT 'Client was not found.' ;

在我尝试处理异常的最后if (inv_port is null) then EXCEPTION e_no_client;程序之前:

end

问题是我需要在 when SQLCODE 219 /*e_no_client*/ do begin error_code = 1; execute procedure p_LOG('p_DEAL: Client was not find.'); -- select * from RDB$EXCEPTIONS; EXCEPTION; end 之后写when后执行语句?

我尝试从do表中编写when E_NO_CLIENTRDB$EXCEPTION_NUMBER(如示例代码中所示)。

1 个答案:

答案 0 :(得分:2)

'when'之后的'p''例外'帮助我:

   when exception e_no_client  do
        begin
         error_code = 1;
         execute procedure p_LOG('p_DEAL: Client was not find.');
         suspend;
        end