【发布时间】:2019-07-30 06:04:35
【问题描述】:
我尝试为应用程序中的状态创建迷你工作流程。
如果我有一个问题的状态,那么我只能在一个已定义的情况下更改它
否则,您会从应用程序中获得无法更改的信息
代码由名为 IFS ERP 的应用程序编译和使用
我认为这很简单,但是当触发器打开时我几乎没有错误
例如: 执行语句失败 (ORA-06550: linia 3, kolumna 27: PLS-00201:必须声明标识符“WORKDONE”
Declare
status_old varchar2(20) :=&OLD:WO_STATUS_ID;
status_new varchar2(20) :=&NEW:WO_STATUS_ID;
begin
if status_old like 'WorkRequest' and status_new not like 'UnderPreparation' then
IFSAPP.Error_SYS.Record_General('C_PURCH_REQ_SUB1','You can't change status on W przygotowaniu ');
ELSIF
status_old like 'UnderPreparation' and status_new not like 'Prepared' then
IFSAPP.Error_SYS.Record_General('C_PURCH_REQ_SUB1','You can't change status on Przygotowane ');
ELSIF
status_old like 'Prepared' and status_new not like 'Released' then
IFSAPP.Error_SYS.Record_General('C_PURCH_REQ_SUB1','You can't change status on Aktywowane');
ELSIF
status_old like 'Released' and status_new not like'Started' then
IFSAPP.Error_SYS.Record_General('C_PURCH_REQ_SUB1','You can't change status on Rozpoczęte ');
ELSIF
status_old like 'STARTED' and status_new not like 'WorkDone' then
IFSAPP.Error_SYS.Record_General('C_PURCH_REQ_SUB1','You can't change status on Wykonane');
ELSIF
status_old like 'WorkDone' and status_new not like 'Reported' then
IFSAPP.Error_SYS.Record_General('C_PURCH_REQ_SUB1',' You can't change status on Odebrane');
end if;
end;
有没有可能让它变得更简单?
【问题讨论】:
-
为什么要使用
&以及&NEW:WO_STATUS_ID的值将设置在哪里? -
实际执行的语句是什么,会引发异常?看起来它可能来自匿名块而不是触发器(并且包含完整的触发器代码会很有帮助,而不仅仅是修改后的 PL/SQL 部分;假设这实际上是您所指的触发器)。