How to convert text to hyperlinks using SQL queries with SQL for Confluence
This article explains how to convert text to hyperlinks using SQL queries in the SQL for Confluence app.
Instructions
Insert an SQL macro on a Confluence page and edit the macro.
Select the relevant SQL profile in the SQL macro editor. For this example, the following details are taken from the database and the link is added to the Name column:
Use the following SQL query to convert the names (in this example, Zack, Ram, and Krish) as hyperlinks wherein the link contains all the values of the respective column values:
select '<a href="http://www.bobswift.com/SEQ_' || name || '/SEQ_' || age || '.htm">' || name || '</a>' AS "Hire"from emp_info_SR
The first column shows the hyperlinks as required. In this example, pointing to a name in the Name column shows the relevant link as follows:
Ensure that the SQL macro is set with the required parameters.
Ensure to update the query to match with other databases as required.