Updated on 2024-08-29 GMT+08:00

SQL Query

DAS allows you to easily run various SQL statements in a graphical SQL window and to perform operations on databases, such as adding, deleting, editing, and viewing a database.

Precautions

  • After a database is created, you need to create a schema before performing any SQL operations.
  • SQL operations are performed on tables and views in a database.

Procedure

  1. Log in to the DAS console.
  2. Click in the upper left corner and select a region and project.
  3. Click in the upper left corner, and under Databases, click Data Admin Service.
  4. In the navigation pane on the left, choose Development Tool.

    You can also click Go to Development Tool on the overview page.

  5. Locate the DB instance that you want to log in to and click Log In in the Operation column.
  6. On the top menu bar, choose SQL Operations > SQL Query.
  7. Check whether there are any schemas other than system schemas.

  8. In the navigation tree on the left of the SQL window, select a table or view.

    Figure 1 SQL window

    You can perform the operations listed in Table 1 in the SQL window.

    Table 1 Function description

    Function

    Description

    Execute SQL

    Executes SQL statements.

    SQL operations are performed on tables and views in a database.

    Format SQL

    Improves readability of SQL statements. Formatting SQL statements enables statements to be displayed in line break mode, but does not change their logics and semantics.

    SQL formatting takes effect for all the SQL statements in the SQL window. You cannot format only one selected statement.

    Execute SQL Plan

    Reports execution of SQL statements to make troubleshooting easy and optimize SQL processing performance.

    SQL Favorites

    Allows you to add, view, and manage frequently-used SQL statements.

    Save Executed SQL Statements

    Saves the recently executed SQL statements to the server.

    SQL Input Prompt

    Helps you quickly enter a specific database, table, or field name when you enter a SQL statement in the SQL window.

    Full Screen

    Shows SQL statements on a full screen.

    Executed SQL Statements

    Shows SQL execution details.

    Messages

    Shows the SQL execution output.

    Result Set

    Shows SQL execution results.

    Allows you to view details about a single row, add a row, submit for editing, delete a row, export a row, copy a row, copy a column, set a column, and more.

    Overwrite/Append Mode

    • Append Mode: Each time a SQL statement is executed, the new result set is appended to the previous one.
    • Overwrite Mode: Each time a SQL statement is executed, the new result set overwrites the previous one.