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.

DELETE_RECORD built-in<br />

Description<br />

When used outside an On-Delete trigger, removes the current record from the block and marks the record<br />

as a delete. Records removed with this built-in are not removed one at a time, but are added to a list of<br />

records that are deleted during the next available commit process.<br />

If the record corresponds to a row in the database, <strong>Form</strong> <strong>Builder</strong> locks the record before removing it and<br />

marking it as a delete.<br />

If a query is open in the block, <strong>Form</strong> <strong>Builder</strong> fetches a record to refill the block if necessary. See also the<br />

description for the CLEAR_RECORD built-in subprogram.<br />

In an On-Delete trigger, DELETE_RECORD initiates the default <strong>Form</strong> <strong>Builder</strong> processing for deleting a<br />

record during the Post and Commit Transaction process, as shown in Example 2 below.<br />

Syntax<br />

PROCEDURE DELETE_RECORD;<br />

82<br />

Built-in Type restricted procedure<br />

Enter Query Mode no<br />

Parameters<br />

none<br />

DELETE_RECORD examples<br />

Example 1<br />

/*<br />

** Built-in: DELETE_RECORD<br />

** Example: Mark the current record in the current block for<br />

** deletion.<br />

*/<br />

BEGIN<br />

Delete_Record;<br />

END;<br />

Example 2<br />

/*<br />

** Built-in: DELETE_RECORD<br />

** Example: Perform <strong>Form</strong> <strong>Builder</strong> delete record processing<br />

** during commit-time. Decide whether to use this<br />

** Built-in or a user exit based on a global flag<br />

** setup at startup by the form, perhaps based on<br />

** a parameter.<br />

** trigger: On-Delete<br />

*/<br />

BEGIN<br />

/*<br />

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

*/<br />

IF :Global.Using_Transactional_Triggers = ’TRUE’ THEN<br />

User_Exit(’my_delrec block=EMP’);

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

Saved successfully!

Ooh no, something went wrong!