thanks for all who reply, specialy Christian Brauer, who sugest to create a
Table loaded by a 4GE program with the function err_get().
Why not. I thing it's a very good and simple idea.
There is an example how i do that.
--
-- Exception handler...
--
on exception
set lv_sqlcode, lv_isamerr, lv_sqlmsg
begin
define lv_str_tmp char(10);
define lv_err_text like tg_sqlerrors.err_text;
define lv_msg_tmp char(255);
let lv_err_text = null;
let lv_msg_tmp = "TG_chk_legalnum_SP Error ";
if ( lv_sqlcode < 0 and lv_sqlcode != -746 ) then
let lv_str_tmp = lv_sqlcode;
let lv_msg_tmp = trim(lv_msg_tmp) || " (" || trim(lv_str_tmp) || ")";
let lv_err_text =
( select err_text
from tg_sqlerrors -- TG stand for "Tabela Global"/"Global Table"
where err_code = lv_sqlcode
);
let lv_stat = dbinfo('sqlca.sqlerrd2');
if ( lv_stat = 0 ) then
let lv_err_text = null;
end if;
end if;
if ( lv_sqlmsg is not null and lv_sqlmsg != ' ' ) then
let lv_msg_tmp = trim(lv_msg_tmp) || " :" || trim(lv_sqlmsg);
end if;
if ( lv_err_text is not null and lv_err_text != ' ' ) then
let lv_msg_tmp = trim(lv_msg_tmp) || " :" || trim(lv_err_text);
end if;
raise exception -746, 0, lv_msg_tmp;
end;
end exception;
_______________________________________________
Rodrigo Filipe
Dp. Sistemas de Informa''o (sv. Desenvolvimento)
SOPORCEL, S.A. - Figueira da Foz - Portugal
mailto:rfilipe@soporcel.pt
Internet : http://www.soporcel.pt
_______________________________________________