A user-defined function can be used, subject to permissions, in any place you would use a built-in non-aggregate function.
Executing the following statement in Interactive SQL uses the FullName user-defined function to return a full name from two columns containing a first and last name:
SELECT FullName(GivenName, Surname) AS "Full Name" FROM Employees; |
Full Name |
---|
Fran Whitney |
Matthew Cobb |
Philip Chin |
... |
Executing the following statement in Interactive SQL uses the FullName user-defined function to return a full name from a supplied first and last name:
SELECT FullName('Jane', 'Smith') AS "Full Name"; |
Full Name |
---|
Jane Smith |
Any user who has been granted EXECUTE permissions for the function can use the FullName function.
Discuss this page in DocCommentXchange.
|
Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1 |