HPlogo ALLBASE/SQL Reference Manual > Chapter 10 SQL Statements A - D

DROP TABLE

MPE documents

Complete PDF
Table of Contents
Index

E0300 Edition 9 ♥
E0399 Edition 8
E0897 Edition 7

The DROP TABLE statement deletes the specified table, including any hash structure or constraints associated with it, all indexes, views, and rules defined on the table, and all authorizations granted on the table.

Scope


ISQL or Application Programs

SQL Syntax



  DROP TABLE [Owner.]Tablename

Parameters


[Owner.]TableName

identifies the table to be dropped.

Description


  • The DROP TABLE statement may invalidate stored sections. Refer to the ALLBASE/SQL Database Administration Guide for additional information on section validation.

  • You cannot drop a table which has a primary or unique constraint referenced by a foreign key in another table. (You can, however, if the only foreign keys are within the same table.)

  • Any authorities used to authorize a foreign key on the table are released when the table is dropped.

Authorization


You can issue this statement if you have OWNER authority for the table or if you have DBA authority.

Example


This table is private by default.

   CREATE TABLE VendorPerf
               (OrderNumber  INTEGER  NOT NULL,
               ActualDelivDay  SMALLINT,
               ActualDelivMonth  SMALLINT,
               ActualDelivYear  SMALLINT,
               ActualDelivQty  SMALLINT
               Remarks  VARCHAR(60) )
            IN Miscellaneous

      CREATE UNIQUE INDEX VendorPerfIndex
                   ON VendorPerf
                       (OrderNumber)

   CREATE VIEW VendorPerfView
               (OrderNumber,
               ActualDelivQty,
               Remarks)
     AS SELECT OrderNumber,
               ActualDelivQty,
               Remarks
          FROM VendorPerf

Only the table creator and members of authorization group Warehse can update table VendorPerf.

   GRANT UPDATE ON VendorPerf TO Warehse

The table, the index, and the view are all deleted; and the grant is revoked.

   DROP TABLE VendorPerf




DROP RULE


DROP TEMPSPACE