user204069
user204069

Reputation: 1091

Syntax error at position 7: no viable alternative at input 'table'

Environment:

Cassandra and CLI version is 1.2.12
OS                           Windows7 Enterprise, 64 Bit.

ran cassendra-cli.bat, When running the create table command I get following:

[default@unknown] create table us(name varchar); Syntax error at position 7: no viable alternative at input 'table'

Any idea why its throwing error ?

Upvotes: 1

Views: 7529

Answers (1)

AndySavage
AndySavage

Reputation: 1769

You are using the older CLI client. This is pre-CQL and uses the Thrit API. If you want to use that client then check out the older docs. The general view is that CQL is the way to go though.

To use CQL use the CQLSH client instead.

One thing to note, even in CQL your statement is not valid. You must specify a primary key.

create table us(name varchar, primary key (name));

Upvotes: 4

Related Questions