Introduction to Batches

A simple batch consists of a set of SQL statements, separated by semicolons.

For example, the following statements form a batch that creates an Eastern Sales department and transfers all sales representatives from Massachusetts (MA) to that department.

See SQL Anywhere 11.0.1 > SQL Anywhere Server - SQL Usage > Stored Procedures and Triggers > Using procedures, triggers, and batches > Introduction to batches.

Sybase IQ example

Note:

For examples, use the Sybase IQ demo database iqdemo.db.

INSERT 
INTO Departments ( DepartmentID, DepartmentName )
VALUES ( 220, 'Eastern Sales' ) ;
UPDATE Employees

SET DepartmentID = 220
WHERE DepartmentID = 200
AND state = 'GA' ;

COMMIT ;