...
- Make sure that database connection is successful using SQL for Confluence app.
- Select the Cog wheel) > Manage apps
- Select the SQL app > View and modify data source profiles and ensure that connection to the database is successful.
- Insert an SQL macro inside a Run with a user form and parameters macro:
- Insert SQL statement as per the requirement. In the example below, we consider retrieving data from the table persons:
- Edit the Run macro and add Field settings:
- Select the Field type and add Field key. Here the Field key is considered as per the SQL statement mentioned above (PersonID):
- To enter more than one field, click on Add field:
- Save the macro settings and publish the page.
- Provide input and click Run. As per the above SQL statement and input data entered in the form, data is retrieved from the database:
Info |
---|
Any text in the macro body that begins with $ immediately followed by a key will be replaced by the values provided in the form. |