List of Exercises
Exercise 3: Creating Distinct Data Types and Casts, continued
|
Edit the names of the support routines for the decimal to temperature cast and the integer to temperature cast.
|
The support functions for the decimal to temperature cast and the integer to temperature cast have the same C function name: temperatureCast(). SQL allows routines to have the same name as long as they have different parameters, but ANSI C requires unique routine names. Therefore, BladeSmith does not generate source code until you have made these names unique.
To edit the C function name, double-click the support routine that appears under the cast when you expand the hierarchy in the BladeSmith project window. The Properties dialog box appears.
In the Properties dialog box, click the Language tab, and then take the following actions:
- For the decimal to temperature cast, type DecToTemp for the C routine name and click Apply and then OK.
- For the integer to temperature cast, type IntToTemp for the C routine name and click Apply and then OK.
(The default C routine names for the CTemp to FTemp cast and the FTemp to CTemp cast do not conflict with other routines, so they do not need to be changed.)
Choose Project
Save to save the changes to your project.
|
Create the error message raised if a user enters a temperature lower than absolute zero.
|
Choose Edit
Insert
Error and enter the following information in the New Error wizard.
Error Property
|
Mercury Error Value
|
SQL error code
|
UMRC0
|
Error
locale
|
en_us.1252
|
Register message as...
|
Both
|
SQL error text
|
Temperatures cannot go below absolute zero.
|
Click Finish and choose Project
Save to save your project.
Copyright © 1998, Informix Software, Inc. All rights
reserved.