USE Statements

  • Capella Analytics
  • reference
    +
    This topic describes how a USE statement sets the database name, scope name, or both for the statement that follows.

    When you provide a USE statement, you do not need to explicitly specify a database and a scope in the statement that follows it.

    For information about how Capella Analytics organizes entities into a database.scope.database_object hierarchy and resolves names, see Entities in Capella Analytics Services.

    Syntax

    UseStmnt EBNF
    UseStmnt ::= "USE" DatabaseAndScopeName
    UseStmnt Diagram
    "USE" DatabaseAndScopeName

    The USE statement only works in a conjunction with another statement in a single request.

    Example

    This example sets travel-sample to be the database and inventory to be the scope for whatever statement follows if it omits that information.

     USE `travel-sample`.inventory;