SQL editor
In the Etlworks Explorer, you can write and execute SQL queries for any Connection, including databases, files, web services, Redis, etc.
You can change the size of the SQL editor
panel by dragging the divider between panels up or down.
SQL editor commands
# | Shortcut | Command |
---|---|---|
1 | Ctrl+F2 |
Execute SQL |
1.1 | Ctrl+F3 |
Execute SQL script |
2 | Ctrl+U |
Undo edit |
3 | Ctrl+Y |
Redo edit |
4 | Click Format code |
Format SQL |
5 | Ctrl+Shift+F |
Search & Replace |
6 | Click Go to line |
Go to line |
Write and execute SQL queries for databases
Use the native SQL syntax of the source relational database.
In addition to SELECT SQL
statements, you can execute stored procedures and functions as long as they return a cursor.
Step 1. Select a database Connection
or any node below it.
Step 2. Click Develop SQL
on the toolbar.
Step 3. Write a query, then click Execute SQL (ctrl+F2)
on the editor's toolbar.
You can write queries using the SQL dialect for that specific database. The Etlworks Explorer passes the queries to the database without any preprocessing.
Execute DDL and DML SQL statements
In the Etlworks Explorer, when a database Connection
is selected, it is possible to execute DDL and DML SQL statements.
For example:
update flow
set name = 'test'
where flowid= 123
Just enter an SQL statement and click Execute SQL (ctrl+F2)
.
The Etlworks Explorer will display the number of updated rows.
When working with databases, the Etlworks Explorer automatically sets the Auto Commit
mode to true
, regardless of the Connection's settings. Therefore, the result of executing DML statements (such as UPDATE
, INSERT
, DELETE
, etc.) will become visible to other users immediately.
Execute SQL scripts
The SQL script is a DDL statement such as create procedure
, create function
, create
trigger
, etc., or an anonymous SQL block that contains one or more SQL statements. For example:
begin
dbms_output.put_line('Hello There');
end;
To execute an SQL script, use hotkey ctrl+F3
or select Execute Script (ctrl+F3)
from the dropdown menu.
Write and execute SQL queries for files, web services, and Redis
One of the unique features of the Etlworks Explorer is its ability to execute SQL queries on a dataset of any type, such as files, web services, etc.
Read how to write SQL queries for non-database Connections.
Step 1. Select a Connection
other than a database Connection.
Step 2. Drill down to a particular file, endpoint, or Redis key by clicking on database Connection
.
Step 3. Click Develop SQL
on the toolbar.
Step 4. Write query, then click Execute SQL (ctrl+F2)
on the editor's toolbar.
Execute multiple SQL statements
You can write and execute multiple ;
separated SQL statements. The results for each statement will be displayed in a separate tab as Dataset1
, Dataset2
, Message
, etc.
For example:
update flow
set name = 'test'
where flowid= 123;
select * from flow;
select * from format;
Execute selected SQL statements
If something is selected in the SQL editor
, only the selected SQL will be executed.
Comments
0 comments
Please sign in to leave a comment.