Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cassandra CQL: Unable to insert

Tags:

php

cassandra

cql

This is my query

insert into a1('name',age') values ('dinesh's',12);

I can't insert the value using Cassandra CQL.

How to remove Cassandra escape character using PHP Cassandra CQL method?

like image 365
user1105692 Avatar asked Feb 04 '12 08:02

user1105692


People also ask

How do you insert data into a Cassandra table?

Cassandra Create Data INSERT command is used to insert data into the columns of the table. Syntax: INSERT INTO <tablename> (<column1 name>, <column2 name>....)

What is not allowed in CQL query?

CQL does not support wildcard queries. CQL does not support Union, Intersection queries. Table columns cannot be filtered without creating the index. Greater than (>) and less than (<) query is only supported on clustering column.

Is insert and update same in Cassandra?

Insert, Update, and Upsert Because Cassandra uses an append model, there is no fundamental difference between the insert and update operations. If you insert a row that has the same primary key as an existing row, the row is replaced. If you update a row and the primary key does not exist, Cassandra creates it.


1 Answers

To escape single quotes in CQL you double them up, e.g to enter the string dinesh's you write 'dinesh''s'.

See similar question on the mailing list:

like image 124
DNA Avatar answered Sep 29 '22 18:09

DNA