Creating a user-defined function using SQL Anywhere dialects

Watcom-SQL and Transact-SQL are SQL dialects supported by SQL Anywhere, and can be used when creating user-defined functions.

  1. In Sybase Central, connect to the database as a user with DBA or Resource authority.
  2. From Sybase Central's View menu, select Folders.
  3. In the left pane, right-click Procedures & Functions and select New > Function.
  4. In the Welcome dialog, type a name for the function and select the user who will own the function.
  5. Select the SQL dialect or language for the function. Click Next.
  6. Select the type of value to be returned in the function, and specify the size, units, and scale for the value.
  7. Type a name for the return value and click Next.
  8. Add a comment describing the purpose of the new function. Click Finish.
  9. In the right pane, click the SQL tab to complete the procedure code.


Created November 2, 2009. Send feedback on this help topic to Sybase Technical Publications: pubs@sybase.com