October 2018
Beginner to intermediate
348 pages
10h
English
One of the more controversial features of CQL is the BATCH statement. Essentially, this allows for write operations to be grouped together and applied at once, automatically. Therefore, if one of the statements should fail, they are all rolled back. A common application of this is for developers to write the same data to multiple query tables, keeping them in sync. BATCH statements in CQL can be applied as such:
BEGIN BATCH INSERT INTO security_logs_by_location (location_id,day,time_in,employee_id,mailstop) VALUES ('MPLS2',20180726,'2018-07-26 11:45:22.004','robp','M266'); INSERT INTO security_logs_by_location_desc (location_id,day,time_in,employee_id,mailstop) VALUES ('MPLS2',20180726,'2018-07-26 11:45:22.004','robp','M266'); ...