Chapter 5 Building Triggers and Procedures
Creating a message table
You create a message table which stores error message information.
To create a message table:
- Create a table with columns to store the following information:
Column to store...
|
Description
|
Error number
|
Number of the error message that is referenced in the trigger script
|
Message text
|
Text of message
|
- Generate the table in your database.
- Select Database→Execute SQL.
A dialog box asks you to identify a data source and connection parameters.
- Select a data source and fill in connection parameters.
- Click Connect.
An SQL query editor box appears.
- Type an SQL statement to insert a message number and text in the appropriate columns. You can use the following format for example:
insert into table
values (error number,'error message'
)
insert into ERR_MSG
values (1004,'The value that you are trying to insert does not exist in the referenced table'
)
- Click Execute.
A message box tells you that the command has been successfully executed.
- Click OK.
You return to the SQL query box.
- Click Close.
Copyright (C) 2005. Sybase Inc. All rights reserved.
|
|