Manage packages

更新时间:
复制 MD 格式

In OceanBase Developer Center (ODC), you can click a connection name to open the connection. In the navigation pane on the left, click the Packages tab to view the package list. The package list shows the package objects in the database of the current connection.

In the package list, you can view an object's structure tree or right-click a target object to perform management operations. You can also double-click a package name in the package list to open the package management page. The package management page has a Package Header tab and a Package Body tab.

Structure tree

As shown in the following figure, you can click the drop-down icon next to a package name in the package list to display its structure tree. The structure tree of a package object can have up to six levels. You can right-click an item at any level of the structure tree to view the available operations. For more information about the operations, see the Management operations table in Management operations.

Management operations

By default, package object names in the package list are sorted in ascending order by their first character.

Quick functions

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

Action key

Description

New

Click the New icon to create a package.

Filter

Click the Filter icon to show valid or invalid packages.

Batch Compile

Click the Batch Compile icon to compile package objects in a batch. The options include Compile All Objects and Compile Invalid Objects.

Refresh

After you perform management operations on a package object, refresh the structure tree to display the latest information.

Right-click operations

Right-click an item in the structure tree to open a context menu with several management operations. The following table describes these operations.

Operation

Description

Create Package

Opens the Create Package page, where you can create a new package header.

Create Package Body

Opens the package body definition page, where you can create a package body.

Modifying the Packet Header and Body

Opens the Package Header/Body Edit page, where you can edit the package header and body.

Export

Exports data from a single table. For more information, see Export and import single tables.

Delete

Deletes the current package.

Refresh

After you perform management operations on a package object, refresh the structure tree to display the latest information.

View

Opens the Package Header tab or the Package Body tab to view all basic information and code of the current package.

Edit

Displays the definition statement for the package header or body on the Package Header/Body Edit page. You can then edit the package header or body in the window.

Compile

Compiles the target package.

Run

Runs a stored procedure or function in a subprogram of the package body.

Note

In ODC V4.0.0 and later, set the parameter value to DEFAULT, NULL, or an empty string.

Download

Downloads the SQL file of the package object.

Delete

Deletes the current package body.

Packet Header Tab

On the package management page, you can click the Package Header tab to view the following information:

  • Basic Information: Displays package information such as Package Name, Creator, Creation Time, and Last Modified Time.

  • Code: Displays the definition code of the package header. This section also provides the Edit and Find buttons. The Edit button opens the package header edit page.

Package Body tab

On the package management page, you can click the Package Body tab to view the following information:

  • Basic Information: This section is the same as that on the Package Header tab. It displays package information such as Package Name, Creator, Creation Time, and Last Modified Time.

  • Code: Displays the definition code of the package body. This section also provides the Edit and Find buttons. The Edit button opens the package body edit page.

Package Header/Body Edit page

image.png

In the package list, you can right-click an item and click Edit to open the package edit page. The code area on the edit page displays the definition statement of the package, which you can edit. The toolbar provides the following functions:

Function

Description

Confirm Changes

Click to apply your changes.

Compile

Compiles the statements on the current page. This button is available only on the package body edit page.

Stop

Click this button to stop the running statement.

Debug

Opens the debug page to debug the current package. Debugging PL objects is supported only for connections to OBServer V2.2.70, V3.0.00, and later.

Note

In ODC V4.0.0 and later, set the parameter value to DEFAULT, NULL, or an empty string.

Format

Click this button to format the selected SQL statements or all SQL statements in the current SQL window. This includes operations 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 content.

Undo

Reverts the script to its state before the last operation.

Redo

After you click Undo, re-applies the undone action to the script.

Case

Provides three options: ALL UPPERCASE, all lowercase, and Capitalize First Letter. Converts the selected statements in the script to the corresponding format.

Indent

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

Comment

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