Run a query in a notebook

After creating a notebook, you can write and run SQL queries against different data sources within the same notebook. Query results can be viewed as a table or chart.

Prerequisites

Steps

  1. Open the notebook:
    1. On the main toolbar, click Products iconData Notebook.
    2. Click the notebook.
  2. In a new line, enter two forward slashes (//).
    A query block appears.
  3. Enter a title to identify your query.
    Tip You can use this query in another SQL query within the same notebook.
  4. Write your query.
    Note If you can't write or run a non-query statement (for example, UPDATE), it is because your administrator has restricted it.
  5. Connect to a data source.
  6. On the menu next to the query title, select a database.
  7. Click Run.
    Tip 
    • If the data source requires personal credentials to connect to the data source, a dialog box may appear again to prompt you to enter your credentials. In the dialog box, the value in the Duration field indicates the amount of time you want to remain connected to the data source. The default duration is 2 minutes. You can, however, change the duration.
    • To reduce database load, by default, only the first 100 rows of query results are returned. To remove this limit, on the Run menu of the query block, clear the 100-row limit on this query option, and then click Run again. This option is shown only if the Allow users to query beyond the 100-row limit setting is enabled by your administrator. The maximum number of rows of query results that can be returned is 100,000.
    • To stop running the query, on the Run menu of the query block, click Cancel execution.

    Query results are shown.
    Image of query results as a table
    Image of query results as a chart
Tip 

What's next

Publish the notebook to create an asset.