Termination Message [message #614697] |
Mon, 26 May 2014 03:18 |
Xandot
Messages: 235 Registered: January 2014 Location: India
|
Senior Member |
|
|
Hello All,
I want to restrict the user when certain condition is correct so i want to raise one message like "You can not edit this entry"
and after that pointer goes to the back button ..no data will be commit...
Like in Oracle forms we put :--
"raise form_trigger_failure;" for termination purpose .
Thanks
|
|
|
|
Re: Termination Message [message #614704 is a reply to message #614698] |
Mon, 26 May 2014 04:42 |
Xandot
Messages: 235 Registered: January 2014 Location: India
|
Senior Member |
|
|
Thanks for reply Littlefoot...
My validation are following ....
---------------------------------
declare
v_count number;
begin
select count(*) into v_count from xyz where col1=? ;
if nvl(v_count,0)>1 then
return 'Records exists some where else. ';
else
return null;
end if;
end;
-------------------------------------------
So how can i put this into the function returning error ....
Thanks
|
|
|
|
Re: Termination Message [message #614774 is a reply to message #614747] |
Tue, 27 May 2014 02:19 |
Xandot
Messages: 235 Registered: January 2014 Location: India
|
Senior Member |
|
|
When i am going to put this condition as you mention above so the application raise ORA-06550 (You tried to execute an invalid block of PLSQL code)..
|
|
|
Re: Termination Message [message #614776 is a reply to message #614774] |
Tue, 27 May 2014 02:33 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
True; I wasn't careful enough when replying to your question, sorry. I didn't have Apex at hand at the moment so I didn't test it.
As it is a function that returns error text, you should return that text directly. So:declare
v_count number;
begin
select count(*)
into v_count
from xyz
where col1 = <what? Can't be a question mark, as you put it>;
if v_count > 1 then
return ('Records exist somewhere else');
end if;
end;
You don't have to enter anything into the "Error message" (the one I called "Message text" previously) field.
[Updated on: Tue, 27 May 2014 02:34] Report message to a moderator
|
|
|
|