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.
    /
    SQL-file

    SQL-file

    Jun 08, 2018

    On this page

    Description

    This macro has similar parameters as the SQL Macro and behaves similarly in most cases. There are 2 primary reasons for using sql-file:

    • Security — it can be secured separately from the other SQL macros. 
      • Using Macro Security for Confluence, more general users can be authorized to use this macro since the administrator controls what queries can be accessed.
      • When not using Macro Security for Confluence, the administrator can disable the sql and sql-query macros and still allow the sql-file macro since it has a fixed set of queries that can be run. 
    • Simplified File Access — the modified parameter makes it easier to specify and read SQL from files.

    Usage Parameters

    ParameterRequiredDefaultMacro Browser LabelDescription
    Data Source
    (may be restricted)
    (tick)
    Data Source NameSpecify the Data Source name. It represents an application server defined Data Source or Data Source Profile defined by your administrator.

    file
    (may be restricted)

    (tick)
    File

    File path in the configured Confluence server home directory under the script directory.

    Output

    Output format

    Determines how the output is formatted:

    • HTML — Generates HTML from the result set data. Data is HTML encoded unless encoding has been disabled.
    • wiki — Generates and renders wiki markup from result set data. If the data might contain unintended wiki markup characters, set the escape parameter to true.
    • XHTML (Pro Edition) — Generates and renders XHTML from result set data. Data is HTML encoded unless encoding has been disabled (disableAntiXss).
    • unrenderedWiki (Pro Edition) — Generates wiki markup from result set data, similar to wiki, without rendering. Wraps with a table-plus macro suitable for copying to another system.

    For more information on Common SQL parameters, refer to Working with SQL parameters - 9.x.

    Examples

    • Using SQL-file with Markup

    Explore SQL Parameters

    The SQL Macro has dozens of built in parameters that you can explore and apply. 

     

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

    Need support? Create a request with our support team.

    Copyright © 2005 - 2025 Appfire | All rights reserved.

    {"serverDuration": 13, "requestCorrelationId": "32c73ad7b3b345a38ac565bfebab5735"}