SHOW APPLICATION PACKAGES

列出您在 Native Apps Framework 中对整个账户具有访问权限的应用程序包。

输出返回应用程序包元数据和属性,根据名称按字典顺序排序。如果您希望使用提供的筛选器筛选结果,请务必注意这一点。

另请参阅:

ALTER APPLICATION PACKAGECREATE APPLICATION PACKAGEDROP APPLICATION PACKAGE

语法

SHOW APPLICATION PACKAGES [ LIKE '<pattern>' ]
  [ STARTS WITH '<name_string>' ]
  [ LIMIT <rows> [ FROM '<name_string>' ] ];
Copy

参数

LIKE 'pattern'

(可选)按对象名称筛选命令输出。筛选器使用 不区分大小写 的模式匹配,并支持 SQL 通配符(%_)。

例如,以下模式返回 相同的 结果:

... LIKE '%testing%' ...
... LIKE '%TESTING%' ...

. 默认:无值(不对输出应用筛选)。

STARTS WITH 'name_string'

(可选)根据对象名称开头显示的字符筛选命令输出。该字符串必须放在单引号内并且 区分大小写

例如,以下字符串会返回 不同的 结果:

... STARTS WITH 'B' ...
... STARTS WITH 'b' ...

. 默认:无值(不对输出应用筛选)

LIMIT rows [ FROM 'name_string' ]

(可选)限制返回的最大行数,同时还对结果启用“分页”功能。返回的实际行数可能小于指定的限制。例如,现有对象的数量小于指定的限制。

可选的 FROM 'name_string' 分子句实际上会充当结果的“游标”。这样就可以提取对象名称与指定字符串匹配的第一行之后的指定行数:

  • 该字符串必须放在单引号内并且 区分大小写

  • 该字符串不必包含完整的对象名称;支持部分名称。

默认:无值(不对输出应用限制)

备注

对于支持 FROM 'name_string'STARTS WITH 'name_string' 的 SHOW 子句,您可以将这两个子句组合在同一语句中。但是,两个条件都必须满足,否则它们相互抵消,不返回任何结果。

此外,对象按名称的字典顺序返回,因此 FROM 'name_string' 仅返回字典值高于 STARTS WITH 'name_string' 所返回行的行。

例如:

  • ... STARTS WITH 'A' LIMIT ... FROM 'B' 不会返回任何结果。

  • ... STARTS WITH 'B' LIMIT ... FROM 'A' 不会返回任何结果。

  • ... STARTS WITH 'A' LIMIT ... FROM 'AB' 将返回结果(如果有任何行与输入字符串匹配)。

使用说明

  • 该命令不需要正在运行的仓库即可执行。

  • 该命令仅返回当前用户的当前角色已获授至少一项访问权限的对象。

  • MANAGE GRANTS 访问权限隐式允许其持有者查看账户中的每个对象。默认情况下,只有账户管理员(具有 ACCOUNTADMIN 角色的用户)和安全管理员(具有 SECURITYADMIN 角色的用户)才具有 MANAGE GRANTS 权限。

  • 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.

示例

SHOW APPLICATION PACKAGES;
Copy
+-------------------------------+-------------------------+------------+------------+--------------+----------------+----------+---------+----------------+------------+-------------------+-----------+
| created_on                    | name                    | is_default | is_current | distribution | owner          | comment  | options | retention_time | dropped_on | application_class | type      |
| 2023-06-02 16:28:31.371 -0700 | hello_snowflake_package | N          | N          | INTERNAL     | ACCOUNTADMIN   |          |         | 1              | NULL       | NULL              | NATIVE    |
+-------------------------------+-------------------------+------------+------------+--------------+----------------+----------+---------+----------------+------------+-------------------+-----------+
语言: 中文