Editing Tables

You can create and edit objects using Edit Table wizard available from the Edit menu in Actions (three vertical dots) besides the table entity.

Clicking Edit from the Actions menu opens the Edit Table wizard. You can visit the panes in any order to edit a table. The table properties are grouped in several panes.

The different panes in the dialog are described in the following sections:

Columns Pane

Specifies properties for each column in the table.

General tab

Lists the columns available in the table.To add a column, click Add Column (+). A new row is added to the table below. Select the row and enter the details for the column. To delete a column, select the row and click Remove Column (-). To move a column up or down in the table, select it and use the up-arrow and down-arrow icons.

In the table:

Constraints tab

Displays the Not Null and Check Constraints for a column. A check constraint requires values in a column to comply with a specified condition.

Primary Key Pane

Specifies the primary key for the table.

The primary key is the column, or set of columns, that uniquely identifies each row in the table. If the Primary Key checkbox is selected for a column in the General tab, the corresponding fields are automatically populated in the Primary Key pane. You can make changes to the properties as required.

An index is automatically created on the primary key.

Unique Keys Pane

Specifies one or more unique constraints for the table.

A unique constraint specifies a column, or set of columns, whose data values must be unique: each data value must not be null, and it must not be the same as any other value in the column.

To add a unique constraint, click the Add button; to delete a unique constraint, select it and click the Remove button.

Indexes Pane

Lists the indexes defined for the table.

To add an index, click Add Index (+); to delete an index, select it and click Remove Index (-).

Foreign Keys Pane

Specifies one or more foreign keys for the table.

A foreign key specifies a column (“local column”), whose data values match values in the primary key or unique constraint of another table.

Table Constraints Pane

Specifies one or more check constraints for the table.

A check constraint specifies a condition that must be met when a row is inserted into the table or when an existing row is modified.

Comments Pane

Enter descriptive comments in this pane.

This is optional.

Storage Pane

Enables you to specify storage options for the table.

When you create or edit a table or an index, you can override the default storage options.

External Table Properties Pane

Specifies options for an external table.

An external table is a read-only table whose metadata is stored in the database but whose data in stored outside the database.

External Table

Opaque Format Spec

Specifies all access parameters for the ORACLE_LOADER, ORACLE_DATAPUMP, ORACLE_HDFS, and ORACLE_HIVE access drivers.

CLOB Subquery

Type or copy and paste the query.

Materialized View Pane

Specifies options for a materialized view.

Query: Contains the SQL code for the query part of the view definition. Type or copy and paste the query.

General

Refresh Clause

DDL Pane

You can review and save the SQL statements that are generated when creating or editing the object. If you want to make any changes, go back to the relevant panes and make the changes there.

For a new table, click CREATE to view the generated DDL statements.

When you edit table properties, click UPDATE to view the generated ALTER statements.

For a new table, the UPDATE tab will not be available. When you are finished, click Apply.

Output Pane

Displays the results of the DDL commands.

If there are any errors, go to the appropriate pane, fix the errors, and run the commands again. You can save to a text file or clear the output.