HP c-tree-SQL ISQL and Tools manual Isql Delete from Custmast, Isql Insert Into Custmast

Models: c-tree-SQL ISQL and Tools

1 99
Download 99 pages 4.83 Kb
Page 21
Image 21

Quick Tour

The first process has the record associated with customer number 1003 locked. Meanwhile the second process has attempted to delete the contents of the customer master table and has been blocked when attempting to lock the table. At this point both processes are effectively blocked. The first process is holding the lock waiting on a keystroke and the second is waiting to grab the lock.

Typing "COMMIT WORK;" from the utility in the first process will unlock the record and allow execution to resume in the second process.

Below is the interactive SQL for MANAGE:

Delete Records

ISQL> DELETE FROM CUSTMAST;

Add Records

ISQL> INSERT INTO CUSTMAST

VALUES ('1000', '92867', 'CA', '1', 'Bryan Williams', '2999

Regency', 'Orange');

ISQL> INSERT INTO CUSTMAST

VALUES ('1001', '61434', 'CT', '1', 'Michael Jordan', '13 Main', 'Harford');

ISQL> INSERT INTO CUSTMAST

VALUES ('1002', '73677', 'GA', '1', 'Joshua Brown', '4356 Cam bridge', 'Atlanta');

ISQL> INSERT INTO CUSTMAST

VALUES ('1003', '10034', 'MO', '1', 'Keyon Dooling', '19771 Park

Avenue', 'Columbia');

ISQL> COMMIT WORK;

Update Record

ISQL> UPDATE custmast SET cm_name = 'KEYON DOOLING' where cm_custnum = '1003';

2.3.4Done

When a client application has completed operations with the server, it must release resources by disconnecting from the data- base. iSQL is an application that provides an interface for inter- active SQL. It may not be explicit but a connection is made with the server when the isql tool is launched. Likewise, a disconnect occurs when the isql tool is quit.

Below is the interactive SQL for DONE:

ISQL> quit

This will return the process back to a regular command line prompt.

FairCom Corporation

2-11

Page 21
Image 21
HP c-tree-SQL ISQL and Tools manual Isql Delete from Custmast, Isql Insert Into Custmast