HPlogo ALLBASE/SQL Reference Manual: HP 9000 Computer Systems > Chapter 10 SQL Statements A - D

ADD DBEFILE

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

The ADD DBEFILE statement updates a row in SYSTEM.DBEFile to show the DBEFileSet with which the file is associated.

Scope

ISQL or Application Program

SQL Syntax

  ADD DBEFILE DBEFileName TO DBEFILESET DBEFileSetName

Parameters

DBEFileName

is the name of a DBEFile previously defined and created by the CREATE DBEFILE statement.

DBEFileSetName

is the name of a previously defined DBEFileSet. You can use the CREATE DBEFILESET statement to define DBEFileSets.

Description

  • You cannot insert any rows or create any indexes for a table or put any non-null values in a LONG column until the DBEFileSet it is located in has DBEFiles associated with it.

  • You can add DBEFiles to the SYSTEM DBEFileSet.

  • Before a DBEFile can be added to the SYSTEM DBEFileSet, other users' transactions must complete. Other users must wait until the transaction that is adding the DBEFile to SYSTEM has completed.

  • ADD DBEFILE increases the number of files associated with the DBEFileSet shown in the DBEFSNDBEFILES column of SYSTEM.DBEFileSet by one.

Authorization

You must have DBA authority to use this statement.

Example

   CREATE DBEFILE ThisDBEFile WITH PAGES = 4,
                  NAME = 'ThisFile', TYPE = TABLE
   
   CREATE DBEFILESET Miscellaneous
   
   ADD DBEFILE ThisDBEFile TO DBEFILESET Miscellaneous

The DBEFile is used to store rows of a new table. When the table needs an index, a DBEFile to store rows of the index is created:

   CREATE DBEFILE ThatDBEFile WITH PAGES = 4,
                  NAME = 'ThatFile', TYPE = INDEX
   
   ADD DBEFILE ThatDBEFile
   
   TO DBEFILESET Miscellaneous

When the index is subsequently dropped, its file space can be assigned to another DBEFileSet.

   REMOVE DBEFILE ThatDBEFile FROM DBEFILESET Miscellaneous
   
   ADD DBEFILE ThatDBEFile TO DBEFILESET SYSTEM
 
   ALTER DBEFILE ThisDBEFile SET TYPE = MIXED

All rows are later deleted from the table, so you can reclaim file space.

   REMOVE DBEFILE ThisDBEFile FROM DBEFILESET Miscellaneous
 
   DROP DBEFILE ThisDBEFile
 
   The DBEFileSet definition can now be dropped.
 
   DROP DBEFILESET Miscellaneous
Feedback to webmaster