All Products
Document Center


Last Updated:Aug 24, 2022

This topic describes the SQL syntax that is used to switch to the destination database.


   ::= USE database_name;





The name of the destination database to which you want to switch. The following requirements must be met:

  • The destination database exists.

  • The name of the destination database must be an SQL constant or identifier.


  • After you explicitly specify the destination database in the USE statement, if you do not explicitly specify the name of the database to which a database object such as a time series table belongs when you specify the database object in an SQL query, the database object is searched from the database in the current context by default.

  • When you use Lindorm-cli or Java Database Connectivity (JDBC) to establish a connection to access LindormTSDB, you usually specify a database name in the connection string. This way, the database can be accessed by default. In this case, if you execute the USE statement, the database is switched based on the context of the current connection.