faisal shaik
faisal shaik

Reputation: 160

Can We Insert the Data into Cassandra Database using INSERT Query

I am working with wso2dss And using Cassandra database as per Wso2dss they showed update example .while i am using INSERT query its throwing errors My query is like

 <query id="Insertinto" useConfig="CassandraDS">
     <sql>INSERT INTO StudentID('First Name','Last Name','Subjects','Class')  VALUES(?,?,?,?)</sql>
     <param name="First Name" ordinal="1" sqlType="STRING"/>
     <param name="Last Name" ordinal="2" sqlType="STRING"/>
     <param name="Subjects" ordinal="3" sqlType="STRING"/>
     <param name="Class" ordinal="4" sqlType="STRING"/>
  </query>

But i am getting error like below

[2013-06-25 11:38:38,060] ERROR {org.wso2.carbon.dataservices.core.DBDeployer} -  The CassandraStudentsSample.dbs service, which is not valid, caused {1}
DS Fault Message: Invalid query param name: 'first name', must be an NCName.

Upvotes: 0

Views: 170

Answers (2)

poohdedoo
poohdedoo

Reputation: 1268

If you are using the where clause you have to make sure you have indexed your Column Family when creating the Column Family or else you cannot use the where clause.

Upvotes: 1

The given error is thrown because of 'First Name' and 'Last Name' has spaces. Remove them and invoke. Are you getting the same error after removing them?

Upvotes: 0

Related Questions