You can call this operation to query details about tables in a database.


OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. You can use OpenAPI Explorer to search for API operations, call API operations, and dynamically generate SDK sample code.

Request parameters

Parameter Type Required Example Description
Action String Yes ListTables

The operation that you want to perform. Value: ListTables .

DatabaseId String Yes 1

The ID of the database.

PageNumber Integer Yes 1

The page number of the returned page.

Tid Long Yes -1

The ID of the tenant.

Note The tenant ID is taken from the tenant ID displayed when you move the pointer on your profile picture. For more information, see View tenant information .
PageSize Integer No 10

The number of the entries to return on each page.

SearchName String No test

Table keyword and prefix match.

ReturnGuid Boolean No true

Specifies whether to return the GUID of the table.

RegionId String No cn-hangzhou

Region-based API request parameters.

Response parameters

Parameter Type Sample response Description
ErrorCode String UnknownError

The error codes.

ErrorMessage String UnknownError

The error message of the failure.

RequestId String B16FB618-5E96-4FFD-BB0D-490C890A4030

The ID of the request.

Success Boolean true

Indicates whether the call was successful.

TableList Array of Table

The details of the table.

DatabaseId String 1

The ID of the database.

Description String test

The description of the table.

Encoding String utf8

The table encoding.

Engine String innodb

The engine of the table.

NumRows Long 1

The number of rows in the table. This is a statistical value and does not indicate the accurate number of rows.

OwnerIdList List 1

The ID of a table Owner.

OwnerNameList List owner_name

The nickname of the table Owner.

StoreCapacity Long 1024

The storage space occupied by the table. This is a statistical value and does not indicate the accurate storage space.

TableGuid String IDB_308302.yuyang_test.test_ch

The GUID of the table.

TableId String 1

The ID of the table.

TableName String test

The name of the table.

TableSchemaName String test_db

The name of the database to which the table belongs.

TableType String NORMAL

The type of the table. Default value: NORMAL.

TotalCount Long 12

The total number of tables that met the query conditions.


Sample request

     http(s)://[Endpoint]/? Action=ListTables &DatabaseId=1 &PageNumber=1 &Tid=-1 &<common request parameters> 

Sample success responses

XML format

     <TableList> <Table> <TableSchemaName>yuyang_test</TableSchemaName> <OwnerNameList> <OwnerNames>xxx</OwnerNames> <OwnerNames>xxx</OwnerNames> </OwnerNameList> <DatabaseId>116367</DatabaseId> <Encoding>utf8mb4</Encoding> <NumRows>3</NumRows> <StoreCapacity>1</StoreCapacity> <TableName>base_user</TableName> <TableGuid>IDB_18396363.yuyang_test.base_user</TableGuid> <TableType>NORMAL</TableType> <OwnerIdList> <OwnerIds>88653</OwnerIds> <OwnerIds>104442</OwnerIds> </OwnerIdList> <Engine>InnoDB</Engine> <TableId>18396363</TableId> </Table> <Table> <TableSchemaName>yuyang_test</TableSchemaName> <OwnerNameList> <OwnerNames>xxx</OwnerNames> <OwnerNames>xxx</OwnerNames> </OwnerNameList> <DatabaseId>116367</DatabaseId> <Encoding>utf8mb4</Encoding> <NumRows>2</NumRows> <StoreCapacity>1</StoreCapacity> <TableName>biz_orders</TableName> <TableType>NORMAL</TableType> <OwnerIdList> <OwnerIds>88653</OwnerIds> <OwnerIds>104442</OwnerIds> </OwnerIdList> <Engine>InnoDB</Engine> <TableId>18390459</TableId> </Table> </TableList> <TotalCount>12</TotalCount> <RequestId>B16FB618-5E96-4FFD-BB0D-490C890A4030</RequestId> <Success>true</Success> 


     { "TableList": { "Table": [ { "TableSchemaName": "yuyang_test", "OwnerNameList": { "OwnerNames": [ "xxx", "xxx" ] }, "DatabaseId": 116367, "Encoding": "utf8mb4", "NumRows": 3, "StoreCapacity": 1, "TableName": "base_user", "TableGuid": "IDB_18396363.yuyang_test.base_user", "TableType": "NORMAL", "OwnerIdList": { "OwnerIds": [ 88653, 104442 ] }, "Engine": "InnoDB", "TableId": 18396363 }, { "TableSchemaName": "yuyang_test", "OwnerNameList": { "OwnerNames": [ "xxx", "xxx" ] }, "DatabaseId": 116367, "Encoding": "utf8mb4", "NumRows": 2, "StoreCapacity": 1, "TableName": "biz_orders", "TableType": "NORMAL", "OwnerIdList": { "OwnerIds": [ 88653, 104442 ] }, "Engine": "InnoDB", "TableId": 18390459 } ] }, "TotalCount": 12, "RequestId": "B16FB618-5E96-4FFD-BB0D-490C890A4030", "Success": true } 

Error codes

For more information about error codes, see error center.