Creating a Scalar Function

A scalar function takes a list of scalar arguments and return a single scalar value.

  1. In the left pane of the Administration Console, expand ASE Servers > Compiled Objects > Functions, then select Scalar Functions.
  2. Click the drop-down arrow and select New.
  3. On the Introduction screen, select the server, database, and owner of the new function.
  4. Enter the name of the function.
  5. Select the datatype of the value returned by the function.
  6. On the Compilation Option screen, you can elect to have your function recompiled every time it is executed. This is useful if you expect parameter values to change frequently. If you do not select this option, the function is compiled only the first time it is executed.
  7. On the SQL Editor screen, provide the SQL statements for the scalar function. Ensure that all objects referenced by the function exist in the database.
  8. (Optional) Click Preview to see the SQL statements for your command.
  9. (Optional) Click Summary to verify your selected options.
Related reference
Scalar Function Properties