You can include one or more SELECT statements in a batch.
The following is a valid batch:
IF EXISTS( SELECT * FROM SYSTAB WHERE table_name='Employees' ) THEN SELECT Surname AS LastName, GivenName AS FirstName FROM Employees; SELECT Surname, GivenName FROM Customers; SELECT Surname, GivenName FROM Contacts; END IF;
The alias for the result set is necessary only in the first SELECT statement, as the server uses the first SELECT statement in the batch to describe the result set.
A RESUME statement is necessary following each query to retrieve the next result set.