Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 12.0.0 (中文) » SQL Anywhere 服务器 - SQL 的用法 » 存储过程和触发器 » 使用过程、触发器和批处理 » 用户定义的函数简介

 

调用用户定义的函数

在您要使用内置的非集合函数的任何地方,都可以根据权限使用用户定义的函数。

以下语句在 Interactive SQL 中从包含名字和姓氏的两列返回全名:

SELECT FullName(GivenName, Surname) 
 AS "Full Name"
 FROM Employees;
Full Name
Fran Whitney
Matthew Cobb
Philip Chin
...

以下语句在 Interactive SQL 中从提供的名字和姓氏返回全名:

SELECT FullName('Jane', 'Smith') 
 AS "Full Name";
Full Name
Jane Smith

已被授予函数的 EXECUTE 权限的任何用户都可以使用 FullName 函数。

 示例
 注意