Skip to end of banner
Go to start of banner

How to pass variable from sql-query macro to status macro or nested sql-query macro

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 4 Next »

This article explains how to use the functions in MySQL using the app SQL for Confluence (Pro Edition).

Instructions

Follow the steps:

  1. Login to the Confluence instance.

  2. Go to the required confluence page and edit the same.

  3. Add SQL macro and go to the Edit option to open the settings for SQL settings.

  4. Select the Data source profile and write the SQL statement as shown in the below image.
    a. CONCAT ()

    select user_name, active, 
    case
        when active = 'T' then CONCAT('{status:color=red|title=', active, '}')
        when active = 'F' then CONCAT('{status:color=yellow|title=', active, '}')   
        else CONCAT('{status:color=red|title=', active, '}') 
    end as "Status"
    from cwd_user;



    b. JOIN ()

    SELECT * FROM cwd_user LEFT JOIN cwd_group on cwd_user.directory_id = cwd_group.directory_id



  • No labels