SQL Query macro - 10.x

On this page

Description

This macro has the same parameters and behavior as that of the SQL macro. There are two primary reasons for using the SQL Query macro:

  • Read-only enforcement - Some databases/JDBC drivers support read-only SQL statements. In this case, the SQL Query macro will attempt to use this support if applicable. Otherwise, it behaves exactly like the SQL macro.
    (info) Read-only support means that the database can optimize for read-only statements. For some databases (PostgreSQL, for instance) the read-only condition is enforced while in others, it is a suggestion for improving performance.
  • Security — Using Macro Security for Confluence, administrators can set varying and separate restrictions for the use of the SQL and SQL Query macros. Thus allowing for greater flexibility to people who can run statements without having access to other SQL operations. For instance, administrators can create read-only data sources via database access controls and grant access to specific data sources. 

For more information on:

Example: Use SQL File Macro with Markup