...
...
Scenario
Div |
---|
|
Estimated Time: 10 min
|
In this scenario, we will add the SQL -file File macro to a Confluence page by inserting Markup from the menu. The SQL -file File macro references a file located within the <confluence-home>/script (default) directory on the Confluence server.
...
Code Block |
---|
|
SELECT title as "Title", author as "Author", price as "Retail Price" FROM books WHERE price < 30 ORDER BY title; |
Steps
The following steps demonstrate the steps involved in inserting a SQL -file File macro on a Confluence page.
Table plus |
---|
border | 0 |
---|
heading | 0 |
---|
multiple | false |
---|
enableHeadingAttributes | false |
---|
columnAttributes | style="border:0;width=5%;",style="border:0;width=65%;",style="border:0;width=30%;max-width=30% !important;" |
---|
id | steps_table |
---|
enableSorting | false |
---|
enableHighlighting | false |
---|
|
| Create a Confluence pageCreate a Confluence page that contains a SQL -file File macro. - Create a page named Classic Books in a space accessible to the desired audience.
- Click Save to save the new page.
| |
| | -file Edit the Classic Books page and: - Select Insert Markup markup from the Insert content list at the top menu.
Type the following into the editor window. Note the dataSource name and file name referenced. Code Block |
---|
{sql-file:dataSource=BookWarehouse|file=books.sql} |
- Click Insert to include your Markup within the page.
- Click Save to save your page and view your results.
Alternative method:Edit the Classic Books page and: - On the page, begin typing "{" (open parenthesis) and then type "sql-"
- Select "sql-fileSQL File" from the available list of macros.
- The macro editor dialog will appear.
- Select "BookWarehouse" as the data source name.
- Type "books.sql" into the required "File" field.
Click Save settings to insert your Markup within the page. - Click Save to save your page and view your results.
|
| How to Insert markup from the menu ![](https://appfire.atlassian.net/wiki/download/thumbnails/74321404/SQL%20file%20macro%20example%20using%20markup.gif?version=1&modificationDate=1559060418498&cacheVersion=1&api=v2&width=450)
Alternative method ![](https://appfire.atlassian.net/wiki/download/thumbnails/74321404/Alternative%20method%20SQL%20File%20macro.gif?version=1&modificationDate=1559061575635&cacheVersion=1&api=v2&width=450)
|
|
Explore Tutorials
We've prepared a number of tutorials which demonstrate how to use our SQL macros with the native Chart macro.
Image Removed
Image Added