11.01.2013 Views

Oracle Forms Developer – Form Builder Reference, Volume 1

Oracle Forms Developer – Form Builder Reference, Volume 1

Oracle Forms Developer – Form Builder Reference, Volume 1

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

LOCK_RECORD built-in<br />

Description<br />

Attempts to lock the row in the database that corresponds to the current record. LOCK_RECORD locks<br />

the record immediately, regardless of whether the Locking Mode block property is set to Immediate (the<br />

default) or Delayed.<br />

When executed from within an On-Lock trigger, LOCK_RECORD initiates default database locking.<br />

The following example illustrates this technique.<br />

Syntax<br />

PROCEDURE LOCK_RECORD;<br />

Built-in Type unrestricted procedure<br />

Enter Query Mode no<br />

Parameters<br />

none<br />

LOCK_RECORD examples<br />

/*<br />

** Built-in: LOCK_RECORD<br />

** Example: Perform <strong>Form</strong> <strong>Builder</strong> standard record locking on<br />

the<br />

** queried record which has just been deleted or<br />

** updated. Decide whether to use default<br />

** processing or a user exit by consulting a<br />

** global flag setup at startup by the form,<br />

** perhaps based on a parameter.<br />

** trigger: On-Lock<br />

*/<br />

BEGIN<br />

/*<br />

** Check the global flag we set up at form startup<br />

*/<br />

IF :Global.Non_<strong>Oracle</strong>_Datasource = ’TRUE’ THEN<br />

User_Exit(’my_lockrec block=EMP’);<br />

/*<br />

** Otherwise, do the right thing.<br />

*/<br />

ELSE<br />

Lock_Record;<br />

END IF;<br />

END;<br />

271

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!