7

I used USE billKeyspace; to enter a keyspace and start using it. Now I want to exit this keyspace and enter another keyspace. How to do that?

If I use exit; or quit; it exits out of cql session itself and then I have to connect again.

Pankaj
  • 474
  • 1
  • 3
  • 16

4 Answers4

16

To switch keyspaces I didn't find any other way but to use USE otherKeySpace;.

Pankaj
  • 474
  • 1
  • 3
  • 16
9

You can switch simply by "use" command.

cqlsh>    DESC KEYSPACEs;

system_distributed system_auth system system_traces

cqlsh> use system_distributed;
cqlsh:system_distributed>
cqlsh:system_distributed>
cqlsh:system_distributed> use system_auth;
cqlsh:system_auth>
0

You can do it without use USE command, like this:

 select * from KeySpace1.tbl ;
 select * from KeySpace2.tbl ;
Zia Nazari
  • 331
  • 3
  • 8
0

You should use quotes around your keyspace name, especially if it contains other symbols than letters.

use "test-space";
Vladimir Stanciu
  • 1,468
  • 1
  • 7
  • 24