位置7的语法错误:在输入'表'没有可行的替代, [英] Syntax error at position 7: no viable alternative at input 'table'

查看:215
本文介绍了位置7的语法错误:在输入'表'没有可行的替代,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

环境:

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

运行 cassendra-cli.bat 运行create table命令我得到如下:

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


[default @ unknown] create table us(name varchar);
语法错误位置7:在输入'表'没有可行的替代方案

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

任何想法为什么它的抛出错误? p>

Any idea why its throwing error ?

推荐答案

您使用的是较旧的CLI客户端。这是预CQL并使用Thrit API。如果您要使用该客户端,请查看旧版文档

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.

要使用CQL,请使用CQLSH客户端。

To use CQL use the CQLSH client instead.

有一点要注意,即使在CQL中你的语句是无效的。您必须指定主键。

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));

这篇关于位置7的语法错误:在输入'表'没有可行的替代,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆