Help with Triggers V2 [message #506182] |
Fri, 06 May 2011 20:37 |
|
leodponti
Messages: 2 Registered: May 2011 Location: buenos aires
|
Junior Member |
|
|
Hi, I need some help, I work an migration jobs Oracle Forms 4.5 INp to 10G.
Have any sentence that i havent idea:
DEFINE TRIGGER
NAME = xxxxx
TRIGGER_TYPE = V2
DEFINE STEP
TEXT = <<<
#EXEMACRO NOFAIL NULL;
>>>
REVERSE = ON
ENDDEFINE STEP
Please somebody help me special with REVERSE = ON
I need replace this en PL/SQL Oracle Forms 10G
Thanks, Best Regards, Leo
|
|
|
|
|
Re: Help with Triggers V2 [message #506257 is a reply to message #506249] |
Sat, 07 May 2011 12:17 |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
Do you not have manuals for version 4.5 that tell you?
If not you're going to have to hope someone familiar with that version sees this thread. I know forms well but that means nothing to me.
|
|
|
|
Re: Help with Triggers V2 [message #506574 is a reply to message #506491] |
Tue, 10 May 2011 01:08 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
V2 trigger's REVERSE RETURN CODE hint says:
Quote:
Should the return code be inverted for this step? (Success -> Failure)
For example: trigger step query isselect 'x' from emp
where empno = :blk_emp.empno
If such an employee already exists in a table, SELECT would return 'x'. It is a success. However, if "Reverse" is checked, trigger will return failure; you can even specify the "Failure message": "Employee already exists".
This is how it looks like:
Today, we'd write a function that returns Boolean, such ascreate or replace function fun_emp (par_empno in number)
return boolean
is
l_var varchar2(1);
begin
select 'x'
into l_var
from emp
where empno = par_empno;
-- Success! Return FALSE
return (false);
exception
-- Failure! Return TRUE
when no_data_found then
return (true);
end;
Now some bad news from my side: my first Forms version was 3.0 which already had V3 style triggers ("normal" PL/SQL code), as opposed to previous V2 style. I "inherited" an old application that still used V2 triggers; quite a nightmare. As those versions were used in pre-Internet era, there are no manuals available (at least, I can't find any) so I can't really translate actual OP's code (#EXEMACRO NOFAIL NULL).
I *think* that EXEMACRO means that Forms should run pre-defined, built-in macro whose name is NOFAIL. But, what would "NOFAIL NULL" be, can't tell for sure.
|
|
|
|