外部表常规控制命令External table general control commands
有关外部表的概述,请参阅外部表。See external tables for an overview of external tables. 以下命令与任何外部表(任何类型)相关。The following commands are relevant to any external table (of any type).
.show external tables.show external tables
- 返回数据库中的所有外部表(或特定外部表)。Returns all external tables in the database (or a specific external table).
- 需要数据库监视者权限。Requires Database monitor permission.
语法:Syntax:
.show
external
tables
.show
external
tables
.show
external
table
TableName.show
external
table
TableName
输出Output
输出参数Output parameter | 类型Type | 说明Description |
---|---|---|
TableNameTableName | stringstring | 外部表的名称Name of external table |
TableTypeTableType | stringstring | 外部表的类型Type of external table |
文件夹Folder | stringstring | 表的文件夹Table's folder |
DocStringDocString | stringstring | 用来记录表的字符串String documenting the table |
属性Properties | stringstring | 表的 JSON 序列化属性(特定于表的类型)Table's JSON serialized properties (specific to the type of table) |
示例:Examples:
.show external tables
.show external table T
TableNameTableName | TableTypeTableType | 文件夹Folder | DocStringDocString | 属性Properties |
---|---|---|---|---|
TT | BlobBlob | ExternalTablesExternalTables | DocsDocs | {} |
.show external table schema.show external table schema
- 以 JSON 或 CSL 形式返回外部表的架构。Returns the schema of the external table, as JSON or CSL.
- 需要数据库监视者权限。Requires Database monitor permission.
语法:Syntax:
.show
external
table
TableName schema
as
(json
| csl
).show
external
table
TableName schema
as
(json
| csl
)
.show
external
table
TableName cslschema
.show
external
table
TableName cslschema
输出Output
输出参数Output parameter | 类型Type | 说明Description |
---|---|---|
TableNameTableName | stringstring | 外部表的名称Name of external table |
架构Schema | stringstring | JSON 格式的表架构The table schema in a JSON format |
DatabaseNameDatabaseName | stringstring | 表的数据库名称Table's database name |
文件夹Folder | stringstring | 表的文件夹Table's folder |
DocStringDocString | stringstring | 用来记录表的字符串String documenting the table |
示例:Examples:
.show external table T schema as JSON
.show external table T schema as CSL
.show external table T cslschema
输出:Output:
json:json:
TableNameTableName | 架构Schema | DatabaseNameDatabaseName | 文件夹Folder | DocStringDocString |
---|---|---|---|---|
TT | {"Name":"ExternalBlob",{"Name":"ExternalBlob", "Folder":"ExternalTables","Folder":"ExternalTables", "DocString":"Docs","DocString":"Docs", "OrderedColumns":[{"Name":"x","Type":"System.Int64","CslType":"long","DocString":""},{"Name":"s","Type":"System.String","CslType":"string","DocString":""}]}"OrderedColumns":[{"Name":"x","Type":"System.Int64","CslType":"long","DocString":""},{"Name":"s","Type":"System.String","CslType":"string","DocString":""}]} |
DBDB | ExternalTablesExternalTables | DocsDocs |
csl:csl:
TableNameTableName | 架构Schema | DatabaseNameDatabaseName | 文件夹Folder | DocStringDocString |
---|---|---|---|---|
TT | x:long,s:stringx:long,s:string | DBDB | ExternalTablesExternalTables | DocsDocs |
.drop external table.drop external table
- 删除外部表Drops an external table
- 无法在此操作后还原外部表定义The external table definition can't be restored following this operation
- 需要数据库管理员权限。Requires database admin permission.
语法:Syntax:
.drop
external
table
TableName [ifexists
].drop
external
table
TableName [ifexists
]
输出Output
返回已删除表的属性。Returns the properties of the dropped table. 有关详细信息,请参阅 .show external tables。For more information, see .show external tables.
示例:Examples:
.drop external table ExternalBlob
TableNameTableName | TableTypeTableType | 文件夹Folder | DocStringDocString | 架构Schema | 属性Properties |
---|---|---|---|---|---|
TT | BlobBlob | ExternalTablesExternalTables | DocsDocs | [{ "Name": "x", "CslType": "long"},[{ "Name": "x", "CslType": "long"}, { "Name": "s", "CslType": "string" }]{ "Name": "s", "CslType": "string" }] |
{} |