Skip to end of banner
Go to start of banner

Using the SQL Macro with Markup - 9.x and earlier

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Current »

Scenario

Estimated Time: 8 min

In this scenario, let's insert the SQL Macro on a Confluence page by inserting Markup from the menu. The SQL macro uses the SQL statement loaded into the body of the macro.

Background

This scenario uses 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 |
+----+------+-------------------+-----------------+---------+

For information about data source profiles, refer to:

The sample query against 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

The following steps demonstrates how to use Markup to insert the SQL macro on a Confluence page:

Explore Tutorials

We've prepared a number of tutorials which demonstrate how to use our SQL macros with the native Chart macro.

  • No labels