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

Executing SQL Statements

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. Select a database and schema from the navigation tree on the left.
  8. Enter a SQL statement in the SQL window and click Execute SQL.

    • Enabling SQL Input Prompt is recommended. It helps you select the required database, table, or field name when you enter a SQL statement in the SQL window.
    • If you want to execute multiple SQL statements at a time, separate them using semicolons (;) and click Full Screen to view logics in the SQL statements.
      • To execute some of the SQL statements, select the statements before executing them.
      • To execute all SQL statements, do not select any SQL statements or select all SQL statements.

    If there are special characters in a table or field name in a SQL statement, make sure that they use double quotation marks.

    Example:

    SELECT * FROM "case_insenSITIVE_tb1!~@#$^%&*)(_+ASDHBHYZXfadsdjalskjfdlajlcakl";

  9. View execution details of the current SQL statement and previously executed SQL statements in the lower part of the page.
  10. Click the Messages tab, view SQL execution details, including affected rows, progress, and time required.

    Figure 1 Viewing messages

  11. On the Result Set tab, view SQL execution results. You can perform the following operations on the result sets:

    • Copy Row/Copy Column: copies a row or column for reuse.
    • Column Settings: customizes the columns to display when there are a large number of columns in the query result.
    • Refresh: refreshes the changed data.
    • Row Details: displays the column field name, value, and type of the selected row.