Help with Triggers V2 [message #506182] |
Fri, 06 May 2011 20:37 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](http://www.gravatar.com/avatar/894167dbd52b52292e7eeda166cf44a3?s=64&d=mm&r=g) |
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 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
cookiemonster
Messages: 13937 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 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](http://www.orafaq.com/forum/images/custom_avatars/72104.gif) |
Littlefoot
Messages: 21818 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:
![/forum/fa/8952/0/](/forum/fa/8952/0/)
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.
|
|
|
|