Categories:

System functions (Control)

SYSTEM$SET_DEFAULT_COLUMNS_OVERRIDE_FOR_SHOW_COMMAND

Controls the columns that should be returned when the specified SHOW <objects> command is executed.

You can call this function if the introduction of new columns in a SHOW COMMAND introduces a problem with a script or code that depends on a fixed number or order of columns in the results. See Handling new columns in SHOW command output and Snowflake views.

See also:

SYSTEM$GET_DEFAULT_COLUMNS_OVERRIDE_FOR_SHOW_COMMAND , SYSTEM$UNSET_DEFAULT_COLUMNS_OVERRIDE_FOR_SHOW_COMMAND , SYSTEM$GET_ALL_DEFAULT_COLUMNS_OVERRIDES

语法

SYSTEM$SET_DEFAULT_COLUMNS_OVERRIDE_FOR_SHOW_COMMAND(
  '<object_type>',
  '<list_of_columns>'
)

实参

'object_type'

Type of object for the SHOW command. For example, for the SHOW TABLES command, specify 'TABLES'. For the SHOW NOTIFICATION INTEGRATIONS command, specify 'NOTIFICATION INTEGRATIONS'.

list_of_columns

应在 SHOW 命令的输出中返回的,以逗号分隔或空格分隔的列的列表。

您可以以大写、小写或混合大小写形式指定列名。

To return all columns, specify an empty string or call SYSTEM$UNSET_DEFAULT_COLUMNS_OVERRIDE_FOR_SHOW_COMMAND.

返回

如果操作成功,返回 TRUE。

访问控制要求

只有账户管理员(被授予 ACCOUNTADMIN 角色的用户)可以调用此函数。

示例

The following example configures the SHOW TABLES command to return only the name, database_name, kind, and comment columns:

SELECT SYSTEM$SET_DEFAULT_COLUMNS_OVERRIDE_FOR_SHOW_COMMAND(
  'TABLES',
  'name, database_name, kind, comment'
);

执行 SHOW TABLES 命令仅返回指定的列:

SHOW TABLES;
+------------------+---------------+-------+---------+
| name             | database_name | kind  | comment |
|------------------+---------------+-------+---------|
| DEPARTMENT_TABLE | MY_DB         | TABLE |         |
| EMPLOYEE_TABLE   | MY_DB         | TABLE |         |
+------------------+---------------+-------+---------+

Executing the SHOW TERSE TABLES command returns only the specified columns except for comment, which isn’t normally returned when you specify TERSE:

SHOW TERSE TABLES;
+------------------+-------+---------------+
| name             | kind  | database_name |
|------------------+-------+---------------|
| DEPARTMENT_TABLE | TABLE | MY_DB         |
| EMPLOYEE_TABLE   | TABLE | MY_DB         |
+------------------+-------+---------------+