Manage triggers

更新时间:
复制 MD 格式

In OceanBase Developer Center (ODC), you can click a connection name to open it. In the navigation pane on the left, click the Triggers tab to view the list of triggers. The trigger list displays the triggers in the database for the current connection. You can right-click a trigger in the list to perform management operations. You can also double-click a trigger name to open the trigger management page.

Management operations

By default, the triggers in the list are sorted in ascending alphabetical order by name.

Quick actions

The following features are available in the upper-right corner of the structure tree:

Action Key

Description

Create

Click the Create icon to create a trigger.

Filter

Click the Filter icon to show or hide valid or invalid triggers.

Refresh

After you manage a trigger, click Refresh to update the structure tree.

Right-click actions

Right-click a target object in the list. The context menu contains several ODC actions for quickly managing the object. The following table lists these actions:

Action Key

Description

View Trigger

Go to the Trigger management page to view the basic information, parameters, and code of the trigger.

Create Trigger

Go to the Create Trigger page and follow the steps to create a new trigger.

Edit

Opens the Trigger edit page, which displays the trigger's definition statement. You can then edit the trigger in the window.

Compile

Compile the current trigger.

Enable

Enable the current trigger.

Disable

Disable the current trigger.

Export

Export data from a single table. For more information, see the Import and Export document.

Download

Download the SQL file of the trigger object.

Delete

Delete the current trigger.

Refresh

Refresh the list to display the latest information after you manage the trigger.

Trigger management page

You can double-click a trigger name in the list to open the trigger management page. This page contains the following three tabs:

  • Basic Information: Displays information such as the Name, Owner, and Status (enabled or disabled) of the trigger.

  • Base Object: Displays information about the trigger's base object, such as its Name, Owner, and Type.

  • DDL: Displays the Data Definition Language (DDL) script that defines the trigger. This tab also provides buttons such as Edit (opens the trigger edit page), Find, and Refresh.

Trigger edit page

To open the trigger edit page, you can right-click a trigger in the list and select Edit. You can also open this page by clicking Edit on the DDL tab of the trigger management page. The code area on the edit page displays the trigger's definition statement for you to edit. The toolbar provides the following buttons:

Feature

Description

Format

Click this button to format the selected SQL statements or all SQL statements in the current SQL window. Formatting includes actions such as indenting, adding line breaks, and highlighting keywords.

Find/Replace

Enter text in the Find box to search the script. Then, enter text in the Replace box to replace the found text.

Undo

Revert the script to the state before the last operation.

Redo

After you perform an Undo operation, re-apply the undone operation to the script.

Case

Provides three options: UPPERCASE, lowercase, and Capitalize. Converts the selected text in the script to the corresponding case.

Indent

Provides two options: Add Indent and Remove Indent. Adds or removes indents for the selected statements in the script.

Comment

Provides two options: Add Comment and Remove Comment. Converts the selected statements in the script to comments or back to SQL statements.

Confirm Changes

Click to apply your changes.