Reputation: 476
I am not able to create table using varchar length property
create table tf (a decimal(9,8) primary key );
create table tf (a varchar(9) primary key );
error :
com.datastax.driver.core.exceptions.SyntaxError:
line 1:26 no viable alternative at input '(' (create table tf (a [decimal](...)
Upvotes: 1
Views: 305
Reputation: 850
In Cassandra, you do not specify the precision of decimals or lengths of varchars. See https://docs.datastax.com/en/dse/5.1/cql/cql/cql_reference/refDataTypes.html.
You will also need to specify a primary key.
Upvotes: 2