Cassandra BATCH Command

Cassandra BATCH Command

Instructor-svgAl-Mamun Sarkar
Sep 20 , 2020

Cassandra BATCH command is used to execute multiple statements (index, delete, update) simultaneously. 

BATCH command:

Syntax:

BEGIN BATCH
insert-statement;
update-statement;
delete-statement;
APPLY BATCH;

Example:

BEGIN BATCH  
INSERT INTO employees (id, city, name, phone, salary) VALUES ( 1, 'Dhaka', 'Mamun', 29345345, 3454 );  
UPDATE  employees set name = 'Sarkar' WHERE id = 1 
APPLY BATCH ;

 

  • Share On:
  • fb
  • twitter
  • pinterest
  • instagram