All Products
Search
Document Center

:Create functions

Last Updated:Nov 22, 2018

This section describes how to create custom functions in DMS.

Prerequisites

You have access permissions to DMS and you have logged on to the DMS console.

Procedure

  1. Choose a target database and click Log On to Database, as shown below:

  2. Functions, stored procedures, and events are programmable objects in DMS. In the left-side directory tree, click Programmable Objects tab. Programmable objects are displayed.

  3. In the left-side directory tree, right-click Function and select Build(Function) in the menu.

    Create a function

  4. Enter the basic information about the function.

  5. Click OK to go to the edit page. DMS generates a function creation template. You only need to enter information in the function part, as shown below:

  6. Enter information in the function parameter.

  7. Click Save. DMS then checks whether the function is correctly defined. If the function definition is incorrect, DMS returns a message. DMS runs the function definition in your database and returns a message to indicate that the function has successfully been saved.

  8. Click Execute to run the function.

  9. Enter a parameter such as wednesday and click Execute. DMS then runs the function.

    This function capitalized the initial of the string correctly. Alter “wednesday” to “Wednesday”.

  10. Click Option Setting to set different options for the function. This operation is similar to Store Procedure.

  11. You can also run the function in the SQL window.