HP 3000 Manuals

Deleting a Data Item [ DBChange Plus User's Guide ] MPE/iX 5.0 Documentation


DBChange Plus User's Guide

Deleting a Data Item 

To delete a data item, use the DELETE ITEM command.  In this section, the
data item LASTSHIPDATE is deleted from the ORDERS database.

When deleting data items, remember the following:

   *   If the data item to be deleted is a field in one or more data
       sets, those fields are also deleted.

   *   If the data item to be deleted is associated with one or more
       paths, those paths are also deleted.

   *   If the data item to be deleted is a key item in an automatic
       master data set, the automatic master data set is deleted.

   *   If the item to be deleted is a sort item in any data set, you must
       first use the DELETE SORT command.

   *   When deleting a key item in a manual master data set, an error is
       not reported until you exit the DBCPLUS program.


CAUTION * If the data item to be deleted is a field in one or more data sets, and those fields contain data, the data in those fields will be lost. * If the data item to be deleted is the only key item in a manual master data set, an error will occur.
Before deleting a data item, the REVIEW ITEMS output looks like this: Itm No. Item Name Attrib Security ------------------------------------------ 1 ACCOUNT I4 (11,12,13,14,18/) 2 BINNUM Z2 (/13) 3 CITY X12 (12,13,14/11) 4 CREDIT-RATING R2 (/14) 5 DATE X6 (11,12,13,14,18/) 6 DELIV-DATE X6 (/14) 7 DESCRIPTION X20 (11,12,13,14,18/) 8 FIRST-NAME X10 (14/11) 9 INITIAL U2 (14/11) 10 LAST-NAME X16 (14/11) 11 LASTSHIPDATE X6 (12/) <---- data item to be deleted 12 ONHANDQTY J2 (14/12) 13 PRICE J2 (14/) 14 PURCH-DATE X6 (11/14) 15 QUANTITY I1 (/14) 16 STATE X2 (12,13,14/11) 17 STOCK# U8 (11,12,14,18/) 18 STREET-ADD X26 (12,13,14/11) 19 SUPPLIER X16 (12,13/) 20 STORE# 8J2 (11,12/14) 21 TAX J2 (14/) 22 TOTAL J2 (11,14/) 23 UNIT-COST P8 (/12) 24 ZIP X6 (12,13,14/11) In the example below, the data item LASTSHIPDATE is deleted using the DELETE ITEM command. LASTSHIPDATE is also a field in the detail data set INVENTORY and will be deleted from the data set. In the following interactive session, a message is displayed asking you to confirm the deletion of the data item. In batch mode, the data item is deleted without confirmation. >delete item lastshipdate Deleting this data item will cause loss of data, delete [y/N]? y Deletion of data item accepted. > Refer to "DELETE ITEM" in chapter 10, "DBChange Plus Commands," for a detailed description of the command syntax and parameters. If you want to verify that the data item LASTSHIPDATE has been deleted from the change file, use the REVIEW ITEMS command. In the following example, the @ parameter is used to display all the data items in the ORDERS database. You can see that LASTSHIPDATE has been deleted. >review items @ REVIEW ITEMS: Itm No. Item Name Attrib Security ------------------------------------------ 1 ACCOUNT I4 (11,12,13,14,18/) 2 BINNUM Z2 (/13) 3 CITY X12 (12,13,14/11) 4 CREDIT-RATING R2 (/14) 5 DATE X6 (11,12,13,14,18/) 6 DELIV-DATE X6 (/14) 7 DESCRIPTION X20 (11,12,13,14,18/) 8 FIRST-NAME X10 (14/11) 9 INITIAL U2 (14/11) 10 LAST-NAME X16 (14/11) 11 ONHANDQTY J2 (14/12) <---- LASTSHIPDATE deleted 12 PRICE J2 (14/) 13 PURCH-DATE X6 (11/14) 14 QUANTITY I1 (/14) 15 STATE X2 (12,13,14/11) 16 STOCK# U8 (11,12,14,18/) 17 STREET-ADD X26 (12,13,14/11) 18 SUPPLIER X16 (12,13/) 19 STORE# 8J2 (11,12/14) 20 TAX J2 (14/) 21 TOTAL J2 (11,14/) 22 UNIT-COST P8 (/12) 23 ZIP X6 (12,13,14/11) If you want to verify that the field LASTSHIPDATE is deleted from the detail data set INVENTORY, use the REVIEW FIELDS command, as shown in the following example: >review fields inventory REVIEW FIELDS (DETAIL SET): Data Set No.: 5 Name: INVENTORY Type: D Fld No. Field Name Pr Sr So Master Set Name Sort Item Name -------------------------------------------------------------------- 1 STOCK# Y PRODUCT 2 ONHANDQTY 3 SUPPLIER Y Y SUP-MASTER 4 UNIT-COST 5 BINNUM <---- LASTSHIPDATE deleted


MPE/iX 5.0 Documentation