A method for generating an execution plan for updating and retrieving data
from a database in a single process includes: receiving a statement by a
server to update a database with a first set of data and to retrieve a
second set of data from the database; building a first execution plan to
update the database with the first set of data; building a second
execution plan to retrieve the second set of data from the database; and
building a single execution plan including a combination of the first and
second execution plans. The single execution plan allows for the updating
and retrieval of data with a single crossing of an interface between a
client and the database. By performing both functions in this manner, the
efficiency of performing such tasks on the database is significantly
increased.