Please enable JavaScript to view this site.

R:BASE 11 Help

Navigation: Command Index > D

DROP (Short Name: DRO)

Scroll Prev Top Next More

Use the DROP command to remove the specified item from the database.

 

DROP

 

Options

 

,

Indicates that this part of the command is repeatable.

 

ALL

Removes all tables from the database.

 

ALL EXCEPT tblname

Removes all tables from the database except the table(s) listed.

 

ALL EXCEPT viewname

Removes all views from the database except the view(s) listed.

 

colname IN tblname

Removes the index from the specified column in the specified table.

 

COLUMN colname FROM tblname

Removes a column's structure and data from the specified table.

 

CURSOR cursorname

Removes the specified cursor. The DROP CURSOR command removes a cursor definition from memory, therefore freeing memory.

 

Cursors are dropped when you use the CONNECT command to open another database, or the DISCONNECT command to close the database.

 

FOR tblname

Removes the rule from the specified table for the specified table.

 

FORM formname

Removes the specified form.

 

INDEX

Removes the index from the column in the specified table.

 

indexname

Removes a named index.

 

LABEL labelname

Removes the specified label.

 

NOCHECK

Eliminates the confirmation message.

 

PROCEDURE procname

Removes the specified stored procedure from the database.

 

REPORT rptname

Removes the specified report.

 

RULE

Removes the specified rule.

 

TABLE

Removes the specified table.

 

tblname

Specifies the table name to be removed.

 

tblname.colname

Removes the index from the specified column in the specified table.

 

VIEW viewname

Removes the specified view.

 

viewname

Specifies the view name to be removed.

 

WITH 'message'

Removes the specified rule from all tables to which it applies. Omitting the WITH 'message' option removes all rules.

 

About the DROP Command

 

The table below lists guidelines for using the DROP command.

 

When you drop...

You must...

A column used in the definition of a computed column

Remove the computed column first.

A column used in a form, report, or label

Delete the column from the form, report, or label definition.

A column used in a rule

Delete the rule for that column in any table from which you removed the column.

A form, report, label, table, or view used in an application

Revise your application to reflect the changes in the database after dropping the form, report, or label.

A view or table used in a form report or label

Delete the form, report, or label from the database after dropping the form, report, or label.

A column or table used in a view

Delete the view from the database.

A table that has rules

Delete the rule with DROP if the table you are dropping is used in the WHERE clause of a rule definition. For example, a table name is used in a WHERE clause of a rule definition when a rule is used to verify a value in one table against values in another table.

 

         

R:BASE deletes the rules if the table is the table on which the rules are based.

 

After running the DROP command, the database item is gone, but the disk space the item occupied is not available. To recover that space, use the PACK or RELOAD commands.

 

You can rebuild a dropped index using CREATE INDEX.

 

When STATICDB is set on-which actives a read-only schema mode-DROP is unavailable.

 

Database Access Rights with DROP

 

The DROP command requires that you enter the database owner's user identifier if a user identifier has been assigned with the GRANT command. However, if a user has CREATE or ALTER access rights, that user can use the DROP command to drop tables or any columns in tables to which the user has rights.

 

Removing Rules with DROP RULE

Before you remove a rule with the DROP RULE command, enter a SELECT command to verify that you would be removing the correct rule from the correct table(s). Use the conditions in a WHERE clause to enter the exact message and any table names that you plan to use in the DROP command. Once you have verified that the message would remove the correct rules, proceed with the DROP RULES command. For example, to verify that a DROP command with the message "Model number must be unique" would remove only the rules you want to remove, enter the following SELECT command. R:BASE would display all the rules for all the tables in the database to which this message applies.

 

SELECT * FROM SYS_RULES WHERE SYS_MESSAGE = 'Model number must be unique'

 

Examples

 

The following command removes the empext column from the employee table.

 

DROP COLUMN empext FROM employee

 

The following two command lines show alternative ways to remove the index from the custid column in the transmaster table.

 

DROP INDEX custid IN transmaster

DROP INDEX transmaster.custid

 

The following command removes from the database all rules with the message 'Model number must be unique.'

 

DROP RULE WITH 'Model number must be unique'

 

The following command removes any rule from the product table that starts with the message 'Model number.' You can use the wildcard character for MANY (%) in a message.

 

DROP RULE FOR product WITH 'Model number%'

 

The following command removes the cursor named cursor1 from memory.

 

DROP CURSOR cursor1