This topic describes how to use HoloWeb to create, edit, delete, copy, and rename SQL queries. The SQL window is designed for interactive, short queries. It is not suitable for offline jobs, such as importing or exporting large volumes of data. SQL queries that run for longer than 60 minutes are not supported.
Prerequisites
You have logged on to an instance. For more information, see Log on to an instance.
Access the SQL Editor
Log on to the Hologres management console.
In the top navigation bar, select a region.
Click Go to HoloWeb to open the HoloWeb developer page.
-
In the top navigation bar of the HoloWeb development page, click .
Create a SQL query
After you go to the SQL Editor page as described in Access the SQL Editor, perform the following steps:
-
In the left-side navigation pane, right-click My SQL query and select Create SQL Query.
Alternatively, click the
icon in the upper-left corner to open a temporary SQL query window to run SQL commands. After you run the commands, you can click Save to save the content of the current SQL window. -
In the Create SQL Query dialog box, configure the following parameters.
Parameter
Description
Job Name
A name for the SQL query.
Directory
The location where the new SQL query is saved.
The default directory is My SQL query. You can also save the query in an existing folder.
New Folder
The name of a new folder in which to save the query.
Instance Name
Select the target instance.
Database Name
The database in the current Hologres instance.
-
Click OK to create the query.
You can also write your queries in the SQL editor by using standard PostgreSQL.
NoteTo query a table with a case-sensitive name, enclose the table name in double quotation marks ("").
Area
Description
①
Displays information about the current session, including the instance name, instance ID, database, current virtual warehouse, and time zone.
②
-
Saves the content of the current SQL window.
-
Refreshes the SQL Editor page.
③
Lists all tables, views, and stored procedures in the target database:
④
-
Run: Executes the SQL commands.
-
Execution Plan: View the execution plan.
-
Analyze: View the run analysis.
-
Stop: Stops the running SQL commands.
-
Format: Formats the SQL commands.
-
Help: Opens documentation about data types, function references, and SQL parameters.
-
Document Settings: Allows you to configure editor settings, SQL parameters, and the time zone.
-
More: Provides options to import or export SQL, or go to DataWorks for SQL development.
⑤
-
: Searches run logs. -
: Close all logs, go to the last page, or display logs. -
: Saves the logs. -
: Pauses log scrolling. -
and
: Resizes the log pane.
Note-
In HoloWeb, a SQL query can run for a maximum of 60 minutes. If a query exceeds this limit, it times out and returns the following message:
cancel query due to timeout, queryTimeout setting is: 3600s. -
Setting
statement_timeoutto more than 60 minutes does not extend the maximum execution time in the HoloWeb SQL window. For more information about how to setstatement_timeout, see Modify the timeout period for an active query.
-
Manage SQL queries
-
Go to the SQL Editor page as described in Access the SQL Editor.
-
In the left-side navigation pane, click My SQL query to view your saved queries. You can then perform the following operations:
NoteIf a query is stored in a folder, you can search for it by name in the search box under Query.
-
Edit a SQL query: Double-click the target query. You can then edit the SQL statements in the SQL editor.
-
Delete a SQL query: Right-click the target query and click Delete SQL Query Task.
-
Copy a SQL query: Right-click the target query and click Copy SQL Query Task. You can then paste the copied SQL statements into another SQL window.
-
Rename a SQL query: Right-click the target query and click Rename. You can then set a new name for the SQL query.
-
: Pauses log scrolling.
and
: Resizes the log pane.