Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device. Atlassian cookies and tracking notice, (opens new window)
Teams
, (opens new window)

SQL for Confluence
Results will update as you type.
  • SQL for Confluence
  • _InclusionsLibrary
  • _Archive
    • User's Guide
      • Macro Reference
        • SQL
        • SQL-file
          • Using SQL-file with Markup
        • SQL-query
      • Understanding Key Concepts
      • Working with SQL parameters
      • Working with Table Parameters
    • Administrator's Guide
    • SQL Macro
    • SQL-file Macro
    • SQL-query Macro
    You‘re viewing this with anonymous access, so some content might be blocked.
    /
    Using SQL-file with Markup

    Using SQL-file with Markup

    Jun 08, 2018

    Scenario

    Estimated Time: 10 min

    In this scenario, we will insert the SQL-file Macro on a Confluence page by inserting Markup from the menu. Our SQL-file Macro will reference a file containing SQL located within the /script (default) directory of your Confluence server.

    Background

    Our scenario will use a Data Source Profile called "BookWarehouse" to query a database table called "BOOKS". The table contains the following columns and rows:

    SQL > select * from books;
    +----+----------------------------+---------------------+-------+
    | id | title                      | author              | price |
    +----+----------------------------+---------------------+-------+
    |  1 | The Grapes of Wrath        | John Steinbeck      | 12.99 |
    |  2 | Nineteen Eighty-Four       | George Orwell       |  8.99 |
    |  3 | The Wind-Up Bird Chronicle | Haruki Murakami     |  7.99 |
    |  4 | Don Quixote                | Miguel De Cervantes | 29.99 |
    |  5 | Pilgrims Progress          | John Bunyan         | 17.99 |
    |  6 | Robinson Crusoe            | Daniel Defoe        | 29.05 |
    |  7 | Gullivers Travels          | Jonathan Swift      | 15.98 |
    |  8 | Tom Jones                  | Henry Fielding      | 13.59 |
    |  9 | Clarissa                   | Samuel Richardson   | 13.59 |
    | 10 | Tristram Shandy            | Laurence Sterne     |  7.59 |
    +----+----------------------------+---------------------+-------+

    Our query will be stored within a file called "books.sql" and we will work with our Confluence administrator to place it within the /script (default) directory on our Confluence server. Our query looks like:

    SELECT title as "Title", author as "Author", price as "Retail Price" FROM books WHERE price < 30 ORDER BY title;

    Steps

    The following steps will demonstrate how to use Markup to insert the SQL-file Macro on a Confluence page.

    Explore Tutorials

    We've prepared a number of tutorials which demonstrate how to use our SQL Macros with the native Chart Macro.



    , multiple selections available, Use left or right arrow keys to navigate selected items
    howto

    Need support? Create a request with our support team.

    Copyright © 2005 - 2025 Appfire | All rights reserved.

    {"serverDuration": 15, "requestCorrelationId": "54c5424ec0474f969f8290660d971c92"}