You can execute the show tables statement to list the names of tables in the current instance.
Note For more information about the show tables statement, see List table names.
Prerequisites
- An OTSClient instance is initialized. For more information, see Initialization.
- A mapping table is created. For more information, see Create mapping tables.
Parameters
Parameter | Description |
---|---|
query | The SQL statement. Configure the parameter based on the required feature. |
Examples
Execute the show tables
statement to list the names of tables.
$request = array(
'query' => "SHOW TABLES;",
);
$response = $this->otsClient->sqlQuery ($request);
$sqlRows = $response['sql_rows'];
print json_encode($sqlRows, JSON_PRETTY_PRINT);