A user-defined function can be used, subject to permissions, in any place you would use a built-in non-aggregate function.
The following statement in Interactive SQL returns a full name from two columns containing a first and last name:
SELECT fullname (emp_fname, emp_lname) FROM employee;
fullname (emp_fname, emp_lname) |
---|
Fran Whitney |
Matthew Cobb |
Philip Chin |
... |
The following statement in dbisql returns a full name from a supplied first and last name:
SELECT fullname ('Jane', 'Smith');
fullname ('Jane','Smith') |
---|
Jane Smith |
Any user who has been granted EXECUTE permissions for the function can use the fullname function.