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.

GO_BLOCK built-in<br />

Description<br />

GO_BLOCK navigates to an indicated block. If the target block is non-enterable, an error occurs.<br />

Syntax<br />

PROCEDURE GO_BLOCK<br />

(block_name VARCHAR2);<br />

Built-in Type restricted procedure<br />

Enter Query Mode no<br />

Parameters<br />

block_name Specifies the name you gave the block when defining it. The data type of<br />

the name is VARCHAR2.<br />

GO_BLOCK examples<br />

244<br />

/*<br />

** Built-in: GO_BLOCK<br />

** Example: Navigate to a block by name. Make sure to check<br />

** that the Go_Block succeeds by checking<br />

FORM_SUCCESS.<br />

*/<br />

BEGIN<br />

IF :Global.Flag_Indicator = ’NIGHT’ THEN<br />

Go_Block(’Night_Schedule’);<br />

/*<br />

** One method of checking for block navigation success.<br />

*/<br />

IF NOT FORM_SUCCESS THEN<br />

RAISE <strong>Form</strong>_trigger_Failure;<br />

END IF;<br />

ELSIF :Global.Flag_Indicator = ’DAY’ THEN<br />

Go_Block(’Day_Schedule’);<br />

/*<br />

** Another way of checking that block navigation<br />

** succeeds. If the block the cursor is in hasn’t<br />

** changed after a block navigation, something went<br />

** wrong. This method is more reliable than simply<br />

** checking FORM_SUCCESS.<br />

*/<br />

IF :System.trigger_Block = :System.Cursor_Block THEN<br />

RAISE <strong>Form</strong>_trigger_Failure;<br />

END IF;<br />

END IF;<br />

Execute_Query;<br />

Go_Block(’Main’);<br />

END;

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

Saved successfully!

Ooh no, something went wrong!