docs-v2/content/influxdb/cloud-dedicated/admin/tables/list.md

2.5 KiB

title description menu weight list_code_example related
List tables Use the [`SHOW TABLES` SQL statement](/influxdb/cloud-dedicated/query-data/sql/explore-schema/#list-measurements-in-a-database) or the [`SHOW MEASUREMENTS` InfluxQL statement](/influxdb/cloud-dedicated/query-data/influxql/explore-schema/#list-measurements-in-a-database) to list tables in a database.
influxdb_cloud_dedicated
parent
Manage tables
201 ###### SQL ```sql SHOW TABLES ``` ###### InfluxQL ```sql SHOW MEASUREMENTS ```
/influxdb/cloud-dedicated/query-data/sql/explore-schema/
/influxdb/cloud-dedicated/query-data/influxql/explore-schema/

Use the SHOW TABLES SQL statement or the SHOW MEASUREMENTS InfluxQL statement to list tables in a database.

{{% note %}} With {{< product-name >}}, tables and measurements are synonymous. {{% /note %}}

SQL
SHOW TABLES
InfluxQL
SHOW MEASUREMENTS

List tables with the influxctl CLI

To list tables using the influxctl CLI, use the influxctl query command to pass the SHOW TABLES SQL statement.

{{% note %}} The influxctl query command only supports SQL queries; not InfluxQL. {{% /note %}}

Provide the following with your command:

  • Database token: Database token with read permissions on the queried database. Uses the token setting from the influxctl connection profile or the --token command flag.
  • Database name: Name of the database to query. Uses the database setting from the influxctl connection profile or the --database command flag.
  • SQL query: SQL query with the SHOW TABLES statement.

{{% code-placeholders "DATABASE_(TOKEN|NAME)" %}}

influxctl query \
  --token DATABASE_TOKEN \
  --database DATABASE_NAME \
  "SHOW TABLES"

{{% /code-placeholders %}}

Replace the following:

  • {{% code-placeholder-key %}}DATABASE_TOKEN{{% /code-placeholder-key %}}: Database token with read access to the queried database
  • {{% code-placeholder-key %}}DATABASE_NAME{{% /code-placeholder-key %}}: Name of the database to query