All Products
Search
Document Center

ApsaraDB for OceanBase:SQL window specification

Last Updated:Jun 11, 2024

This topic introduces how to edit and execute SQL window specifications.

Background information

After the system administrator grants a user the permission to operate on development specifications, the user can manage SQL window specifications on the Environment tab of Security Specifications.

When a user executes an SQL statement in the SQL window, ODC checks the SQL statement against the configured SQL window specifications.

Execution process

image

  1. The ODC system administrator enables SQL approval integration and sets the API information for accessing the external SQL approval system based on the configuration template provided by ODC, and creates the SQL approval integration configuration.

  2. The ODC system administrator enables SQL approval integration on the SQL window specification tab.

  3. An ODC user executes an SQL statement in the SQL window. ODC calls the API of the external SQL approval system to initiate an SQL check request.

Prerequisites

You have the development specifications operation permission.

Procedure

Assume that you want to edit and enable a rule named SQL types allowed to be executed in SQL window on the SQL window specification tab for the SIT environment. Then, edit and execute a SELECT TABLE statement in the SQL window.

Parameter

Example

Project Name

odc_4.2.0

Data Source

mysql_4.2.0

Database Name

odc_test

Table Name

employee

  1. Log on to web ODC. In the project collaboration window, choose Security Specifications > Environment > sit > SQL window specification.

  2. As shown in the preceding figure, on the SQL window specification tab, edit the rule named SQL types allowed to be executed in SQL window.

  3. Click OK.

  4. On the SQL check specification tab, enable SQL types allowed to be executed in SQL window.

  5. In the project collaboration window, choose Projects > All Projects > odc_4.2.0.

  6. Click Database to log on to the database and go to the SQL development window.

  7. In the SQL window, edit the SQL statement to query the employee table, and click Press F8 to run all SQL statements in the current SQL window.

    SELECT `emp_no`, `birthday`, `name` FROM `employee`;
    

References