Altering Database Objects Using SQL Explorer

In SQL Explorer, you can execute the SQL ALTER statement on tables data definitions, procedures, functions and triggers.

Altering Table Data Definitions

To change a data definition in a table:

  1. In the context tree, select the table whose data definitions you want to update.
  2. In the Database Hierarchy menubar, click (Alter). SQL Explorer displays editable column and field names in the query editor. For example, the image below shows the display if you select the HOCKEY table to alter:
  3. Move the focus to a table definition field you want to edit. Execute and Delete Column become active in the menubar.

  4. Update the field value as needed and then move the focus to another field that you want to update. A red triangle appears in the upper left corner of each updated field. The data definition statements that effect the change appear in the SQL Data Definition panel. For example:
  5. Click Execute to save the changes.

When altering table data definitions, the fields you can edit include:

Column Description
Column Name Name of the column in the table.
Type Data type defined for this column.
Size Maximum number of characters.
Scale Number of allowed digits to the right of the decimal point in a number type.
Allows Null If selected, null values are allowed.
Default Value Specifies a default value.

Altering Procedures

To change a procedure, select it in the context tree and click (Alter) in the menubar. The ALTER PROCEDURE statement appears in a new query tab. Edit as needed and then click Execute in the query editor menubar to save it.

Altering Functions

To change a user-defined function, right-click it in the context tree and select Alter from the pop-up menu. The ALTER FUNCTION statement appears in a new query tab. Edit as needed and then click Execute in the query editor menubar to save it. For more information, see ALTER FUNCTION.

Altering Triggers

To change a trigger, select it in the context tree and click (Alter) in the menubar. The ALTER TRIGGER statement appears in a new query tab. Edit as needed and then click Execute in the query editor menubar to save it.