---
title: "SQL-query"
canonical: "https://support.appfire.com/space/SQL/74319368/SQL-query"
format: markdown
---
> Macro (aura-html)

# Description

This macro has all the same parameters as the [SQL Macro](https://appfire.atlassian.net/wiki/spaces/SQL/pages/74320195) and behaves similarly in most cases. There are 2 primary reasons for using **sql-query**:

- **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 available. Otherwise it behaves exactly like the [SQL Macro](https://appfire.atlassian.net/wiki/spaces/SQL/pages/74322843).   
:info:** **Read-only support means the database can optimize for read-only statements to improve performance. For some databases (PostgreSQL for instance), the read-only aspect is enforced while in others, it is only a performance suggestion.
- **Security **— Using [Macro Security for Confluence](https://appfire.atlassian.net/wiki/spaces/CMSP), administrators can configure different restrictions for use of the [SQL](https://appfire.atlassian.net/wiki/spaces/SQL/pages/74322843) and SQL-query macros. This provides greater flexibility by allowing more people to query without having access for other SQL operations. For instance, administrators can create **read-only** data sources using database access controls and only grant access to those specific data sources.

## Usage Parameters

| **Name** | **Required** | **Default Value** | **Macro Browser Label** | **Description** |
| --- | --- | --- | --- | --- |
| Data Source  
(may be restricted) | :check_mark: |  | Data Source Name | <span style="color: #333333">Specify the Data Source name. It represents an application server defined Data Source or Data Source Profile defined by your administrator.</span> |
| Output |  |  | Output format | Determines how the output is formatted:<br>- **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](https://appfire.atlassian.net/wiki/spaces/SQL/pages/74323070/Working+with+SQL+parameters+-+9.x).

## Explore SQL Parameters

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

![image](media://c9edcef9-c080-421a-aea7-26735e1d51f1)


###