Introduction To Batches - Sybase Adaptive Server IQ 12.4.2 Administration And Performance Manual

Table of Contents

Advertisement

Introduction to batches

Introduction to batches
238
A simple batch consists of a set of SQL statements, separated by semicolons.
For example, the following set of statements form a batch that adds a new sales
representative to the Eastern Sales department, and adds two sales orders for
that sales rep.
INSERT INTO
employee (emp_id, emp_fname, emp_lname, dept_id,
start_date)
VALUES (2054, Edward, Baer, 220, 1998-08-15);
INSERT INTO
sales_order (id, cust_id, order_date, fin_code_id,
region, sales_rep)
VALUES (41880, 717, 1998-08-24, BU, PA, 2054) ;
INSERT INTO
sales_order (id, cust_id, order_date, fin_code_id,
region, sales_rep)
VALUES (418898, 021, 1998-08-25, BU, PA, 2054) ;
COMMIT ;
INSERT
INTO department ( dept_id, dept_name )
VALUES ( 220, 'Eastern Sales' )
go
UPDATE employee
SET dept_id = 220
WHERE dept_id = 200
AND state = 'MA'
go
COMMIT
go
You can include this set of statements in an application and execute them
together.

Advertisement

Table of Contents
loading

Table of Contents