DESCRIBE FUNCTION (DMF)¶
描述指定的数据指标函数 (DMF),包括签名(实参)、返回值、语言和正文(定义)。
语法¶
{ DESC | DESCRIBE } FUNCTION [ IF EXISTS ] <name>(
TABLE( <arg_data_type> [ , ... ] ) [ , TABLE( <arg_data_type> [ , ... ] ) ]
)
参数¶
name指定要描述的函数的标识符。
如果标识符包含空格或特殊字符,则整个字符串必须放在双引号内。放在双引号内的标识符也区分大小写。
有关更多信息,请参阅 标识符要求。
TABLE( arg_data_type [ , ... ] ) [ , TABLE( arg_data_type [ , ... ] ) ]指定 DMF 列实参的数据类型。数据类型是必需的,因为 DMFs 支持名称重载(即同一架构中的两个 DMFs 可以具有相同的名称),并且实参的数据类型用于标识要描述的 DMF。
访问控制要求¶
权限 |
对象 |
备注 |
|---|---|---|
USAGE |
数据指标函数 |
The USAGE privilege on the parent database and schema are required to perform operations on any object in a schema. Note that a role granted any privilege on a schema allows that role to resolve the schema. For example, a role granted CREATE privilege on a schema can create objects on that schema without also having USAGE granted on that schema.
有关创建具有指定权限集的自定义角色的说明,请参阅 创建自定义角色。
使用说明¶
To post-process the output of this command, you can use the pipe operator (
->>) or the RESULT_SCAN function. Both constructs treat the output as a result set that you can query.The output column names for this command are generated in lowercase. If you consume a result set from this command with the pipe operator or the RESULT_SCAN function, use double-quoted identifiers for the column names in the query to ensure that they match the column names in the output that was scanned. For example, if the name of an output column is
type, then specify"type"for the identifier.
示例¶
描述 DMF 以查看其属性:
DESC FUNCTION governance.dmfs.count_positive_numbers(
TABLE(
NUMBER, NUMBER, NUMBER
)
);
+-----------+---------------------------------------------------------------------+
| property | value |
+-----------+---------------------------------------------------------------------+
| signature | (ARG_T TABLE(ARG_C1 NUMBER, ARG_C2 NUMBER, ARG_C3 NUMBER)) |
| returns | NUMBER(38,0) |
| language | SQL |
| body | SELECT COUNT(*) FROM arg_t WHERE arg_c1>0 AND arg_c2>0 AND arg_c3>0 |
+-----------+---------------------------------------------------------------------+