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.

ERROR_TEXT built-in<br />

Description<br />

Returns the message text of the <strong>Form</strong> <strong>Builder</strong> error.<br />

Syntax<br />

FUNCTION ERROR_TEXT;<br />

Built-in Type unrestricted function<br />

Enter Query Mode yes<br />

Description<br />

Returns the message text of the <strong>Form</strong> <strong>Builder</strong> error.<br />

Parameters<br />

none<br />

Usage Notes<br />

You can use this function to test error messages during exception handling subprograms.<br />

ERROR_TEXT examples<br />

108<br />

/*<br />

** Built-in: ERROR_CODE,ERROR_TEXT,ERROR_TYPE<br />

** Example: Reword certain FRM error messages by checking<br />

** the Error_Code in an ON-ERROR trigger<br />

** trigger: On-Error<br />

*/<br />

DECLARE<br />

errnum NUMBER := ERROR_CODE;<br />

errtxt VARCHAR2(80) := ERROR_TEXT;<br />

errtyp VARCHAR2(3) := ERROR_TYPE;<br />

BEGIN<br />

IF errnum = 40301 THEN<br />

Message(’Your search criteria identified no matches...<br />

Try Again.’);<br />

ELSIF errnum = 40350 THEN<br />

Message(’Your selection does not correspond to an<br />

employee.’);<br />

ELSE<br />

/*<br />

** Print the Normal Message that would have appeared<br />

**<br />

** Default Error Message Text Goes Here<br />

*/<br />

Message(errtyp||’-’||TO_CHAR(errnum)||’: ’||errtxt);<br />

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

END IF;

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

Saved successfully!

Ooh no, something went wrong!