Create and Map User-defined Functions

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

  1. At a UNIX terminal, navigate to the FunctionEmulation.sql file, located in the $COBDIR/demo/sql/hcoss/functionemulation directory.

    This file contains a script that creates some user-defined math functions needed by the example code.

  2. Execute the following:
    > sqlcmd -S ServerName -U UserID -P Password -d HCO_Test -i functionemulation.sql

Map user-defined functions

  1. From a UNIX terminal or File window, navigate to and open the functionemulation.xml file in a text editor. This file is located in the $COBDIR/demo/sql/hcoss/functionemulation folder by default.
  2. Copy the contents of the functionemulation.xml file.
  3. Navigate to and open the DialectMappings.hcomap file, located in the $COBDIR/etc/hcoss folder.
  4. Insert the copied contents right before the end tag </NameMappingDataSet> in the DialectMappings.hcomap file and save.