Guides you through the steps required to create user-defined functions in SQL Server Management Studio, and to map those
functions using the HCO for SQL Server Customize Name Mappings tool.
Create user-defined functions
- Launch SQL Server Management Studio, and select the
HCO_Test database.
- Navigate to
and open
the
FunctionEmulation.sql file, located in the
%PUBLIC%\Documents\Micro Focus\Enterprise Developer\Samples\Mainframe\SQL\hcoss\FunctionEmulation directory.
This file contains a script that creates some user-defined math functions needed by the example code.
- Click
Execute.
- From the
Object Explorer expand and select
HCO_Test > Programmability > Functions > Scalar-Valued Functions and
Refresh this folder. You should now see the newly created functions.
Map user-defined functions
- Start HCO for SQL Server tools
-
- In
Eclipse, click
Run > Tools > Data Tools > HCO for SQL Server.
- Map the functions for HCOSS
-
- From the HCO for SQL Server interface, click
Customize SQL Name Mappings.
- Scroll to the bottom of the grid and double-click in the first empty cell to activate it for editing. Type the following information
in the appropriate rows and columns, and check the corresponding
Is Function box for each:
DB2 Function/Special Register
|
SQL Server Equivalent
|
atanh
|
dbo.atanh
|
cosh
|
dbo.cosh
|
sinh
|
dbo.sinh
|
tanh
|
dbo.tanh
|
- Click
Save to save the mappings.
- Close the
HCO for SQL Server window.