叽叽歪歪

    follow me on Twitter

    Methods for Database Server-side Messaging

    |

    Database server–side PL/SQL currently has no I/O abilities by itself.Therefore, it relies on the environment that called the server–side routine to output the message.

    There are three distinct, non–interchangeable methods for displaying messages that were set on the server:

    Method 1: Set an error message on the server, to be displayed by the forms client that called the server procedure.

    On the server, use FND_MESSAGE.SET_NAME and FND_MESSAGE.SET_TOKEN to set the message. Then call APP_EXCEPTION.RAISE_EXCEPTION (an APPCORE routine) to raise the application error PL/SQL exception. This exception is trapped when the server procedure is exited and control resumes on the client side in the standard Oracle Forms ON_ERROR trigger. The ON–ERROR trigger retrieves the message from the server and displays it.

    Attention: All forms built to integrate with Oracle Applications should have a form–level ON–ERROR trigger that calls APP_STANDARD.EVENT(’ON–ERROR’). APP_STANDARD.EVENT(’ON–ERROR’) in the ON–ERROR trigger automatically detects application errors raised on the server and retrieves and displays those error messages in a forms alert box.

     

    Method 2: Set a message on the server, to be retrieved on the client side.

    On the server, use FND_MESSAGE.SET_NAME and FND_MESSAGE.SET_TOKEN to set the message. Return a result code to the calling client code to indicate that a message is waiting. If there is a message waiting, the client calls FND_MESSAGE.RETRIEVE to pull the message from the server to the client, placing the message on

    the client’s message stack. The client calls FND_MESSAGE.ERROR,FND_MESSAGE.SHOW, FND_MESSAGE.HINT, or FND_MESSAGE.WARN to display the message, or

    FND_MESSAGE.GET to retrieve the message to a buffer.

     

    Method 3: Get a message into a buffer on the server

    Use the FND_MESSAGE.SET_NAME, FND_MESSAGE.SET_TOKEN,and FND_MESSAGE.GET routines to get the message into a buffer. Or, use FND_MESSAGE.GET_STRING to get a single message into a string.

    0 comments:

    Post a Comment