Attempts to lock the row in the database that corresponds to the current record. LOCK_RECORD locks the record immediately, regardless of whether the Locking Mode block property is set to Immediate (the default) or Delayed.
When executed from within an On-Lock trigger, LOCK_RECORD initiates default database locking. The following example illustrates this technique.
PROCEDURE LOCK_RECORD;
Built-in Type unrestricted procedure
Enter Query Mode no
none
/*
** Built-in: LOCK_RECORD
** Example: Perform Oracle Forms standard record locking on the
** queried record which has just been deleted or
** updated. Decide whether to use default
** processing or a user exit by consulting a
** global flag setup at startup by the form,
** perhaps based on a parameter.
** Trigger: On-Lock
*/
BEGIN
/*
** Check the global flag we set up at form startup
*/
IF :Global.Non_Oracle_Datasource = 'TRUE' THEN
User_Exit('my_lockrec block=EMP');
/*
** Otherwise, do the right thing.
*/
ELSE
Lock_Record;
END IF;
END;