All Products
Search
Document Center

:Anonymous block window

更新時間:Mar 24, 2023

To open an anonymous block window, perform the following steps: enter the Database Management page of OceanBase Developer Center (ODC), click Workspace in the top navigation bar, and click Anonymous Block Window.

An anonymous block window provides the PL editing area and PL execution result and DBMS output tabs.

Image 809

PL editing area

The editing area of the anonymous block window provides many features for you. For example, when you open a new anonymous block window, the guidance code is provided to facilitate your script-writing work. Database keywords are highlighted in different colors. It also provides features such as formatting to help you improve your PL statement writing efficiency.

Image 810

In addition to the preceding features, the toolbar of the editing area provides the following buttons:

Button

Description

Run

Click this button to execute the statements in the code area.

Find and Replace

You can enter text in the search field to find the specific content and enter text in the replacement field to replace the content found.

Undo

Click this button to undo the last operation.

Redo

Click this button to reverse an Undo operation.

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.

IN Value Conversion

Click this icon to convert the copied rows or columns into the specified format during queries.

After you paste the copied data to the SQL editing area, select the copied data and click IN Value Conversion to convert it into the in('A','B') format.

  • Column values are separated with line breaks.

  • Row values are separated with spaces or tabs.

Case Sensitivity

The system supports three configurations: All Caps,All Lowercase, and Capitalize First Letter. Click this icon to convert the selected statements in the script to the corresponding capitalization format.

Indent

You can add indents to or delete indents from the statements that you selected.

Comment

You can click Add Comments to convert the statements that you select into comments or click Delete Comment to convert comments to SQL statements.

Save script

Click this button/use the shortcut key Ctrl+S to save the script in the current window. Click this icon to save the script in the current window. You can open a saved script when you enter the workspace again. You can view only the SQL scripts saved by yourself. The script names must be unique. After you open a stored script, you can continue to edit it.

Snippet

Click this icon to view and reference built-in and custom code snippets.

PL Execution Result and DBMS Output tabs

After you click Run in the toolbar of the editing area to execute the anonymous block, the Execution Result and DBMS Output tabs appear under the editing area.

  • Execution Result: displays the execution result of the script. If the execution was successful, Executed is displayed; otherwise, the error information is displayed.

  • DBMS Output: If a subprogram contains a PL output statement, the output is displayed on this tab after the execution, for example, dbms_output.put_line.