HP (Hewlett-Packard) c-tree-SQL ISQL and Tool reference Guide Printer User Manual


 
Quick Tour
FairCom Corporation 2-13
2.4 TRANSACTION PROCESSING TUTORIAL
iSQL_Tutorial4.sql
This tutorial will introduce the concept of transaction processing,
based on the relational model of the previous tutorial. Records
will be added to tables orderlist and orderitems as a single transac-
tion.
Transaction processing in iSQL is handled by two statements:
1. COMMIT WORK that makes the changes done during the
transaction permanent and starts a new transaction.
2. ROLLBACK WORK that undoes all the changes done during the transaction, reverts the
database to the status before the start of the transaction, and start a new transaction.
Notice that iSQL automatically starts a transaction when launched.
This example, like all others in this set of documentation, will take the creation and use of a
database and fit it into a simple four step flow of initialization, definition, management, and
completion. (Init, define, manage, and you're done!)
Now let's break into the four areas.
2.4.1 Init
The initialize step is as simple as launching the iSQL tool. The
syntax for this is as follows:
isql [-u user_name] [-a password] [connect_string]
At the command line prompt type:
isql -u ADMIN -a ADMIN myDatabase
iSQL responds with the following prompt:
ISQL>
At this point, any valid SQL statement terminated with a semi-colon may be submitted.
2.4.2 Define
In this case define consists of the CREATE TABLE statement.
This is done in a single iSQL statement in which specific fields
are defined. Upon successful creation of the tables, the changes
made to the database by this transaction are made permanent by
executing the COMMIT WORK statement.