Hi all,
I'm using the SQL plugin in a macro and I do a SQL select count request.
The request render a string (for example) <p>3</p>
I have removed the tags but the variable ($OK), is always a string so that I cannot do any calculation after.
Here after is the code:
#set($KO=$helper.renderConfluenceMacro("{sql:datasource=confluence|table=false} select count(PROJECT.CONTENTID) from (select (CONTENT_LABEL.CONTENTID) as CONTENTID from CONTENT_LABEL,LABEL where LABEL.NAME='mi-securetransport' AND LABEL.LABELID = CONTENT_LABEL.LABELID) PROJECT, (select (CONTENT_LABEL.CONTENTID) as CONTENTID from CONTENT_LABEL,LABEL where LABEL.NAME='ko' AND LABEL.LABELID = CONTENT_LABEL.LABELID) LABELOK where PROJECT.CONTENTID = LABELOK.CONTENTID {sql}")) #set($KO1 = $KO.replaceAll("<p>","")) #set($KO2 = $KO1.replaceAll("</p>","")) #set($KO3 = $KO2 + 10) $KO3
KO3 render the string concatenation of KO2 and 10
Have you any solution?
Thanks
Thanks Bob, I hope a lot with your answer but I have tried this in a Confluence macro
#set($intString = "9")
#set($Integer = 0)
$Integer.parseInt($intString)
#set( $ALL = $Integer + 5 )
$ALL
and $ALL always render the concatenation of 9 and 5.
I surely missed something (I'm not a programmer)
What is your opinion?
Best regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry Bob, now it works.
I did that
#set($intString = "9")
#set($Integer = 0)
#set ($a =$Integer.parseInt($intString))
#set( $ALL = $a + 5 )
$ALL
Thanks a lot
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.