Query

Use this component to query a database. While you can type in your SQL query right in the dialog the component comes with two powerful tools to help you build your query:

  • The SQL Query Builder
  • The SQL Explorer

Each will be explained below.

Usage

Return variable

This is the name of your query.

Connection

This dropdown will list all available connections in your script, select the one you want to use.

SQL

This text area holds your SQL query. You can either type it in by hand or use The Query Builder. Note that you don't need the trailing semicolon in the syntax. For example:

select age, name from mytable

The SQL Query Builder

This is a powerful tool that helps you construct SQL queries. It's designed as a wizard with a series of screens:

  1. Table Selection
  2. Column Selection
  3. Data Filter
  4. Grouping Selection
  5. Sequence Selection

You don't need to specify values for all of these screens. The only mandatory step is to select a table.

Table Selection

This screen helps you find the table you want to query. If your database have a large amount of tables you can search for it given its name, description or the schema to which it belongs.

In the Table selection settings you can select if you want to include system tables in the list, as well as if you want to include the schema name when the builder constructs your query. This is sometimes needed for the query to work, the generated table will look something like myschema.mytable instead of just mytable.