Chapter 5 Building Triggers and Procedures


Generating a user-defined error message

You can choose to generate a user-defined error message from the trigger generation parameters box.

Steps To generate a user-defined error message:

  1. Select Tools→Rebuild Objects→Rebuild Triggers.

    The Rebuild Triggers dialog box appears.
  2. Click the Error Messages tab.

    The Error Messages page appears.
  3. Select the User-defined radio button.
  4. Type the name of the table that contains the error message in the Message Table Name box.
  5. Type the name of the column that contains the error number in the Message Number box.
  6. Type the name of the column that contains the error message text in the Message Text column.

    Below is an example of the details for a table called ERR_MSG.
  7. Click the General tab and select the mode and triggers to create.
  8. Click the Selection tab and select the tables for which you want to create triggers.

    For more information on rebuilding triggers, see section Rebuilding Triggers.
  9. Click OK.

    The trigger rebuilding process is shown in the Output window.

    Select Database→Generate Database to open the Database Generation window.
  10. Select generation parameters as required.
  11. Click OK.

    For information on selecting trigger generation parameters, see section Generating Triggers and Procedures.

 


Copyright (C) 2005. Sybase Inc. All rights reserved.