Log on to OceanBase Developer Center (ODC) and click the name of the target connection to go to the corresponding connection management page. You can click Program Package in the left-side navigation pane to get a list of program package objects in the current database.
In the program package list, you can view the structure tree of an object. You can also right-click the target object to perform some management actions on the object. You can also double-click the name of a program package to go to the program package page, which provides a Package Header tab and a Package Body tab.
Structure tree
You can click the expand icon before the name of the target program package in the program package list, and the structure tree of the program package is displayed in a drop-down list, as shown in the following figure. The structure tree of a program package can have up to six levels. When you right-click an item in the tree, the shortcut menu displays some actions that you can perform on the item. For more information about these actions, see the Management actions section, where you can find the table describing the management options.
Management actions
Right-click the target object in the structure tree. A shortcut menu appears, displaying some management options provided by ODC for you to conveniently manage the target object. The following table describes the management options.
Option | Description |
Create Program Package | Click this option to go to the Create Program Package page, where you can create a program package header as prompted. |
Create Package Body | Click this option to go to the package body definition page and create a program package body. |
Edit the package header and package body | Click this option to open both the package header editing and package body editing pages, where you can edit the package header and the package body. |
Remove Program Package | Click this option to delete the program package. |
Refresh | Click this option to refresh the structure tree after you perform management actions on the program package, so that the structure tree displays the latest information. |
View | Click this option to go to the Package Header tab or the Package Body tab, where you can view comprehensive information such as the basic information and code of the program package. |
Edit | Click this option to go to the package header editing and package body editing pages, which display the package header and package body definition statements and where you can continue to edit the package header and the package body. |
Compile | Click this option to compile the program package. |
Run | Click this option to run the stored procedure or function in a subprogram in the program package body. |
Delete | Click this option to delete the body of the program package. |
Package Header tab
On the program package management page, click the Package Header tab. The following information is displayed:
Basic Info: displays the basic information about the package header, including Program Package Name, Created By, Creation Time, and Last Modified At.
Code: displays the code that defines the package header and provides two options: Edit and Find. You can click Edit to go to the package header editing page.
Package Body tab
On the program package management page, click the Package Body tab. The following information is displayed:
Basic Info: displays the basic information about the package header, including Program Package Name, Created By, Creation Time, and Last Modified At.
Code: displays the code that defines the package body and provides two options: Edit and Find. You can click Edit to go to the package body editing page.
Package header/body editing page
Button | Description |
Confirm Modification | Click this button to apply the current modification. |
Compile | Click this button to compile the statements on the current page. This button is available only on the package body editing page. |
Format | Click this button to apply formatting, such as indentation, line break, and keyword highlighting, to the selected SQL statements or all the SQL statements in the current SQL window. |
Find and Replace | You can specify search criteria in the search box to find specific content in the script and enter other content in the replacement box to replace the content found. |
Undo | Click this button to undo the last operation. |
Redo | Click this button to reverse an Undo operation. |
Case Sensitivity | The system supports three configurations: All Caps, All Lowercase, and Capitalize the first letter. Click this button to convert the selected statements in the script to the corresponding capitalization format. |
Indent | The Add Indents and Delete Indent options are provided, to allow you to add indents to or delete indents from the selected statements in the script. |
Comment | The Add Comments and Delete Comment options are provided, which respectively allow you to convert the selected statements in the script to comments and convert comments to SQL statements. |