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)

One Appfire Support Knowledge Base
Results will update as you type.
  • How to display links in SQL results using SQL for Confluence
  • How to resolve an Access denied error - 10.x
  • How to add queries within queries
  • How to resolve an Authentication failed error - 10.x
  • How to avoid format errors when using output=wiki
  • How to resolve broken database connections - 10.x
  • How to resolve a Class not found error - 10.x
  • How to combine queries from multiple databases
  • How to update database columns and display them in a page using Run macro with SQL macro
  • Configure application server based datasources - 10.x
  • Configure data source profiles 10.x
  • How to resolve an Invalid syntax server.xml error
  • How to resolve a Could not create connection to database server error - 10.x
  • Create a chart with SQL - 10.x
  • How to resolve a Data source name not found error - 10.x
  • How to resolve a Database server not found error - 10.x
  • Datasource problem determination - 10.x
  • Example profile configurations
  • Error while retrieving the data using SQL for Confluence
  • How to resolve a Generic SQL exception - 10.x
  • How to find pages that uses a specific data source profile in different SQL macros
  • How to get favorites list of Confluence users using Sql for Confluence
  • How to configure data source profiles for various databases with examples
  • How to do data source problem determination
  • How to handle the "No suitable driver found" error when connecting to an MS-SQL database
  • How to hyperlink the SQL macro results
  • How to implement role based security for SQL queries - 8.x
  • How to improve the display of SQL source - 8.x
  • How to show all table rows using a nested query with SQL for Confluence
  • How to implement role based security for SQL queries - 10.x
  • How to improve the display of SQL source - 10.x
  • How to index SQL data
  • How to use SQL data with inline macros
  • How to resolve a Listener refused connection error - 10.x
  • How to log SQL activity
  • Pro tips
  • How to publish SQL queries on Atlassian Cloud
  • How to run SQL queries securely without page edit restrictions
  • Sample Queries - Confluence Labels
  • How to resolve the Unable to load database driver error
  • How to use Confluence metadata in SQL queries
  • How to use HTML in queries
  • How to use SQL case statement to improve the visual appeal
  • How to use SQL macros securely
  • Using the SQL macro with Markup - 9.x and earlier
  • How to resolve an Oracle validation query throwing exception - 10.x
  • UI caching problem with SQL for Confluence
  • How to create a temporary MySQL table using the SQL for Confluence (Pro edition) app
  • Using SQL File with Markup - 9.x and earlier
  • How to use MySQL functions in SQL macro
  • How to get usage information about the SQL for Confluence app
  • How to create a database profile with read-only access using the SQL for Confluence app
  • How to set SSL connection for SQL server with SQL for Confluence (Pro Edition)
  • Connect SQL macro to MS SQL database using Windows authentication
  • Unable to see table views in SQL macro
  • How to use the Expand array option in SQL for Confluence to view values with line break
  • Use SQL Macro with Markup - 10.x
  • Use SQL File Macro with Markup - 10.x
  • Create a Bar chart using SQL macro
  • Create a Pie chart using the SQL macro
  • Create an xyArea chart using the SQL macro
  • Create an xyLine chart using the SQL macro
  • How to resolve a network error due to invalid database port - 10.x
  • How to resolve isValid exceptions - 10.x
  • How to resolve a Cannot load JDBC driver error - 10.x
  • How to resolve a Permission denied error - 10.x
  • How to resolve a Validation query exception - 10.x
  • How to implement role based security for Postgre SQL database - 10.x
  • How to limit active database connections
  • How to use SQL macro in a Confluence user macro
  • How to use macros parameter within nested SQL queries
  • How to resolve the Unable to connect to database error
  • How to create a chart with SQL - 8.x
  • How to implement role based security for Postgre SQL database - 8.x
  • User Macro with sql-query failed after Confluence upgrade to 7.7 version
  • SSL connection to Oracle DB setup issues in SQL for Confluence
  • Unable to load database driver: com.xxx.jdbc.Driver
  • How to Create a Chart From SQL Data
  • How to Automatically Create a Formatted Table From SQL Data
    You‘re viewing this with anonymous access, so some content might be blocked.
    /
    How to use Confluence metadata in SQL queries
    Updated Feb 28, 2020

    How to use Confluence metadata in SQL queries

    Feb 28, 2020

    Description

    In many cases, you may want your query to know the current logged in user, what page the query is on, or other Confluence related metadata. This is easily done using the Run Self-Service Reports for Confluence and various pre-defined variables. 

    For SQL for Confluence release 5.2 and later, a special substitution variable @user_id@ is available as well. The SQL macros replaces this text with the user ID of the currently logged in user or anonymous, if the user is not logged in.

    {"serverDuration": 14, "requestCorrelationId": "76e572ef0d324b48b7721590170ef7ad"}