【问题标题】:oracle forms 10g runtime timeoutoracle形成10g运行时超时
【发布时间】:2015-12-18 21:30:25
【问题描述】:

我在 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,而不是在客户表中插入新客户(记录)时,表格永远不会响应 你能帮我解决插入语句中的问题吗? 在此先感谢

【问题讨论】:

  • 您是否尝试过添加异常块来捕获任何可能的异常?
  • 理想情况下,您应该在表单中创建一个过程或创建一个数据库存储过程并从when-validate-item 触发器调用或调用该过程。提到这一点,您的错误与程序无关。

标签: oracle-sqldeveloper oracleforms ora-00001


【解决方案1】:

好像:output_header.text_item48已经是char项了所以不用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;

【讨论】:

    猜你喜欢
    • 2020-07-15
    • 1970-01-01
    • 1970-01-01
    • 2010-12-24
    • 2012-02-11
    • 1970-01-01
    • 2011-06-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多