HP 3000 Manuals

Creating DBEFiles for Table and Index Data [ Up and Running with ALLBASE/SQL ] MPE/iX 5.0 Documentation


Up and Running with ALLBASE/SQL

Creating DBEFiles for Table and Index Data 

Next, you can create DBEFiles of three different types--TABLE, INDEX, and
MIXED. In most cases, it is wise to prepare separate DBEFiles for table
data and for indexes, so you will create two DBEFiles--AlbumTables and
AlbumIndex.  (In a later step, you will associate these DBEFiles with the
DBEFileSet ALBUMFS.) First, type the following command:

     isql=> CREATE DBEFILE AlbumTables Return 
     > WITH PAGES=50, Return 
     > NAME='ALBUMD1', TYPE=TABLE; Return 

This command creates a new DBEFile known internally to ALLBASE/SQL as
AlbumTables and to the operating system as ALBUMD1.  The file contains
fifty 4096-byte pages, and is available for storage of table data only.

Now issue the next
command:

     isql=> CREATE DBEFILE AlbumIndex Return 
     > WITH PAGES=30, Return 
     > NAME='ALBUMI1', TYPE=INDEX; Return 

This command creates a new DBEFile known internally to ALLBASE/SQL as
AlbumIndex and to the operating system as ALBUMI1.  This file contains
thirty 4096-byte pages, and is available for storage of indexes only.


Notes The third DBEFile type--MIXED--can store both tables and indexes. DBEFILE0 is an example of a MIXED DBEFile. DBEFILE0, which belongs to the DBEFileSet known as SYSTEM, was created at the time you issued the START DBE NEW command. You can create new DBEFiles and add them to SYSTEM. If you do not specify a DBEFileSet when you create a table, it is stored in the SYSTEM DBEFileSet by default. However, since SYSTEM is already in use with system information, it is better to use separate DBEFileSets and DBEFiles for your data. You'll be creating a table in AlbumFS in the next few sections.
Committing Work Did all three commands complete without any error messages? If so, issue the following command: isql=> COMMIT WORK; Return Committing work is necessary because ALLBASE/SQL processes commands in units known as transactions. When you issue the first SQL command in a sequence, a transaction begins, and that transaction continues until you do a COMMIT WORK or ROLLBACK WORK. The use of transactions guarantees the consistency of data within the DBEnvironment.
NOTE If you received an error message saying that your transaction was rolled back, you should review what you have done, to see if you can spot the error. When you are ready, go back to the CREATE DBEFILESET command above and try again. If the files ALBUMD1 or ALBUMI1 exist, use an operating system command to erase them from the current working directory or group before attempting to issue the CREATE DBEFILE commands again.


MPE/iX 5.0 Documentation