SHOW LISTINGS

Lists the listings that you have privileges to access. Shows only listings where the user running the command has any of USAGE, MODIFY, or OWNERSHIP against the listing.

另请参阅:

CREATE LISTINGALTER LISTINGDESCRIBE LISTINGDROP LISTING

语法

SHOW LISTINGS [ 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' 将返回结果(如果有任何行与输入字符串匹配)。

使用说明

  • You can show a listing only if you use a role that has the USAGE, MODIFY, or OWNERSHIP privilege on the listing.

  • LIMIT rows 的值不能超过 10000。如果省略 LIMIT rows,若结果集大于 1 万行,则该命令将导致错误。

    要查看存在超过 1 万条记录的结果,请在 Snowflake Information Schema 中包含 LIMIT rows 或查询相应的视图。

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

输出

命令输出在以下列中提供列表属性和元数据:

描述

global_name

列表的全局名称

name

创建列表时指定的名称。

title

Title specified in the listing manifest.

subtitle

Sub title specified in the listing manifest.

profile

列表清单中指定的提供商简介名称。

created_on

列表的创建日期和时间。

updated_on

列表的上次更新日期和时间。

published_on

列表的上次发布日期和时间。

state

列表状态,以下之一:

  • DRAFT

  • PUBLISHED

  • UNPUBLISHED

review_state

Review state for public listings only, one of:

  • UNSENT

  • PENDING

  • REJECTED

  • APPROVED

  • CANCELLED

comment

关联的注释(如果存在)。

owner

列表所有者。

owner_role_type

所有者角色类型。

regions

List of regions where a public listing is available.

target_accounts

目标账户的逗号分隔列表。

is_monetized

收费标志。

is_application

应用程序标志。如果为 true,则列表会被附加一个 Snowflake Native App。

is_targeted

针对性标志。

is_limited_trial

Whether the listing is available for limited trial before purchasing.

is_by_request

Whether the listing is a personalized listing.

distribution

Whether the listing is an EXTERNAL or ORGANIZATION listing.

is_mountless_queryable

Whether the listing can be queried by a consumer without mounting using the Uniform Listing Locator (ULL) for the listing.

rejected_on

Date and time when the public listing for approval was last rejected.

organization_profile_name

The profile associated with the ORGANIZATION listing.

uniform_listing_locator

The ULL tha allows consumers to access the organization listing without mounting.

detailed_target_accounts

Private listing target account details with company name included.

compliance_badges

List of compliance certifications that were approved by Snowflake's compliance team for the listing, if any. Available certifications include:

  • SOC2

  • HIPAA

  • ISO27001

示例

显示名称以 MYLISTING 开头的所有列表:

SHOW LISTINGS LIKE 'MYLISTING%'
Copy

显示从列表 MYLISTING 开始的十个列表:

SHOW LISTINGS LIMIT 10 FROM 'MYLISTING%'
Copy
语言: 中文