Hello folks,
I am using Oracle Forms 10g and I am trying to see if a particular record has been locked. If it's been locked (because a User made changes to the record), then I will issue a Message and do a raise form trigger failure. I have created a procedure for it.
So, I have the Student details open in Form 1 for the Student ID. I don't make any changes and then I go ahead and open another session (Same Form and query and same Student ID). Here, even though I made no changes to the record in Form 1, I am getting the exception error in Form 2.
Any help would be great. Meanwhile, here is the piece of code.
For some bizzare reason, it's not allowing me to add the select statement in the code
Its bascially a select statment with a FOR UPDATE NOWAIT
PROCEDURE check_record_locked IS
v_temp varchar2(1);
record_in_use exception;
pragma exception_init(record_in_use, -00054);
cursor c_get_rows_locked is
select 'X'
begin
if :GRAD_STU_BK.student_id IS NOT NULL then
open c_get_rows_locked ;
fetch c_get_rows_locked into v_temp;
message('Temp = '||v_temp);
close c_get_rows_locked;
end if;
exception
when record_in_use then
MESSAGE('You have unsaved changes ...');
raise form_trigger_failure;
end;