Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Scenario

Div
classtime

Estimated Time: 4 min

In this scenario, we will insert the SQL-file Macro on a Confluence page using the Insert Macro menu and have the Macro by inserting Markup from the menu. Our SQL-file Macro will reference a SQL file located within the /scripts (default) directory of your Confluence server.

...

Code Block
languagesql
SELECT title as "Title", author as "Author", price as "Retail Price" FROM books WHERE price < 30 ORDER BY title;

Steps

The following steps will demonstrate how to use Markup to insert the SQL-file Macro on a Confluence page.

Table plus
border0
heading0
multiplefalse
enableHeadingAttributesfalse
columnAttributesstyle="border:0;width=5%;",style="border:0;width=65%;",style="border:0;width=30%;max-width=30% !important;"
idsteps_table
enableSortingfalse
enableHighlightingfalse


Create Confluence page

Create a Confluence page that will eventually contain the SQL-file Macro needed to list out your books.

  1. Create a page named Classic Books in a space accessible to the desired audience.
  2. Click Save to save the new page.






Insert the SQL-file Macro using the Insert Markup Menu

Edit the Classic Books page and

do the following

:

  1. Select Insert Markup from the top menu.
  2. Type the follwing into the editor window. Note the dataSource name and file name referenced. 

    Code Block
     {sql-file:dataSource=BookWarehouse|file=books.sql}


  3. Click Insert to insert your Markup within the page.
  4. Click Save to save your page and view your results.

Insert Markup How to insert Markup from the menu