oracle forms 10g 运行时超时

oracle forms 10g runtime timeout

我在 when-validate-item 触发器中有这段代码

declare
x number;
c varchar2(5);
n varchar2(25);
begin
select COUNT(*) into x from CUSTOMERS where CUSTOMERS.cus_name=:output_header.text_item48;
if x > 0
  then
  NULL;
else
  IF SHOW_ALERT('ALERT56')= ALERT_BUTTON1 THEN
  select to_char(max(customers.cus_id)+1) into c from customers;
  n:=to_char(:output_header.text_item48);
  insert into customers(cus_id,cus_name) values(c,n);
  end if;
END IF;
end;'

此代码应检查输入的客户名称是否已存在,如果不存在,我想创建一个新客户 问题是当我按下警报按钮 1,而不是将新客户(记录)插入客户 table 时,表格变得永远没有响应 你能帮我吗,问题出在插入语句中; 提前致谢

似乎:output_header。text_item48 已经是一个字符项,因此无需使用 to_char 进行转换,请使用以下代码进行测试:

declare
x number;
c varchar2(5);
n varchar2(25);
begin
select COUNT(*) into x from CUSTOMERS where CUSTOMERS.cus_name=:output_header.text_item48;
if x > 0
  then
  NULL;
else
  IF SHOW_ALERT('ALERT56')= ALERT_BUTTON1 THEN
  select to_char(max(customers.cus_id)+1) into c from customers;
  n:= :output_header.text_item48;
  insert into customers(cus_id,cus_name) values(c,n);
  commit;
  end if;
END IF;
end;