Hi,
I would like to have a usermacro, taking the name of the page and constructing a sql statement that I could pass to the sql macro.
The outline is :
#set ($query = "select field1, field2 from somtable where field1 ="+$content.getTitle())
<ac:structured-macro ac:macro-id="f9f4ee50-2e49-463a-8ab5-79cd170f1450" ac:name="sql-query" ac:schema-version="1">
<ac:parameter ac:name="dataSource">mysource</ac:parameter>
<ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter>
<ac:parameter ac:name="table">false</ac:parameter>
<ac:plain-text-body><![CDATA[$query]]></ac:plain-text-body>
</ac:structured-macro>
How do I substitue my $query in the macro ?
Thank you
Christophe
Hi @Christophe Bonvin ,
Thanks for raising your query through Atlassian Community and we have raised to support request https://bobswift.atlassian.net/servicedesk/customer/portal/1/SUPPORT-3076 from our end and please sign up to portal to view the support request.
With the help of Run Macro from Run Self Service Reports app you will be able to configure pre-defined variables for $page_title and the SQL macro needs to be embedded within Run Macro.
Please find below screenshot for your reference and please note that in below screenshot $page_title will be substituted in SQL macro.
Thanks,
Avinash
Hi @Avinash Bhagawati {Appfire} We use SQL for Confluence (Pro Edition) and would like to ask if we can achieve the same thing or if we need Run Macro as well. We are trying to make a SQL Query and use our Confluence page title in the query.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
are you sure there is a "SQL Query" marco in standard Confluence? I'm not sure about that.
Best
JP
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
The issue is not with the sql macro, which is not part of confluence, but provided by Bob Swift from Appfire as a very useful plugin.
The issue is how to pass a variable into CDATA[...] for rendering. With the "old" wiki markup, it was possible to use something like
#set ($runMacro =" {sql-query:datasource=source}select somestuff from sometable{sql-query}")
$action.getHelper().renderConfluenceMacro($runMacro)
I do not know how to do that with the new format.
Regards,
Christophe
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.