/
Use SQL Macro with Markup - 11.x
Use SQL Macro with Markup - 11.x
Scenario
Estimated Time: 8 min
In this scenario, add the SQL macro on a Confluence page by inserting Markup from the Insert more content menu. The SQL macro references, the statements entered in the macro body.
Background
In this scenario, use a data source profile, BookWarehouse, to query a database table, PUBLISHERS. The table contains the following columns and rows:
SQL > select * from publishers; +----+------+-------------------+-----------------+---------+ | id | rank | parent_company | company_name | revenue | +----+------+-------------------+-----------------+---------+ | 10 | 1 | Pearson | Pearson | 5000.00 | | 11 | 2 | Reed | RELXGroup | 4900.00 | | 12 | 3 | WoodbridgeCompany | ThompsonReuters | 4700.00 | | 13 | 4 | BertelsmannAG-NV | Bertelsmann | 4500.00 | | 14 | 5 | WoltersKluwer | WoltersKluwer | 4100.00 | +----+------+-------------------+-----------------+---------+
The illustrative script for querying the PUBLISHERS table looks like:
SELECT rank as "Worldwide Ranking", company_name as "Company", format(revenue,0) as "M Revenue" FROM publishers ORDER BY rank asc;
Steps
Follow the steps below to insert a SQL macro into a Confluence page:
, multiple selections available,
Related content
Use SQL File Macro with Markup - 11.x
Use SQL File Macro with Markup - 11.x
Read with this
SQL macro - 11.x
SQL macro - 11.x
Read with this
SQL Query macro - Cloud
SQL Query macro - Cloud
More like this
Create a Bar chart using SQL macro - 11.x
Create a Bar chart using SQL macro - 11.x
Read with this
Advanced Table Viewer macro [Beta] - cloud
Advanced Table Viewer macro [Beta] - cloud
More like this
Create a dynamic table
Create a dynamic table
More like this