Apache Cassandra 1.2 Documentation

USE

Connects the current client session to a keyspace.

Synopsis

USE keyspace_name | keyspace_name

Description

A USE statement identifies the keyspace that contains the tables to query for the current client session. All subsequent operations on tables and indexes are in the context of the named keyspace, unless otherwise specified or until the client connection is terminated or another USE statement is issued.

To use a case-sensitive keyspace, enclose the keyspace name in double quotation marks.

Example

USE PortfolioDemo;

Continuing with the example in Checking created keyspaces:

USE "Excalibur";