Hello,
I would like to ask your help when it comes to parameters in a query. The query works ok, if the input parameter value does not contain spaces. Once it does, it gives an error. Is there a way around this please?
The example query is simple: SELECT id FROM cwd_group WHERE group_name=:GroupName
GroupName = "confluence-administrators" - no problem
GroupName = "GA Team" - gives a syntax error
org.springframework.jdbc.BadSqlGrammarException: select id from cwd_group where group_name=?
Thank you very much for your help.
Hi Marketa,
Thanks for raising this question! It's actually very strange -- your query works totally fine for me. I created a group with name "group with spaces". I used your statement and I simply enter the group name in the macro browser:
image2015-12-10 8:23:58.png
image2015-12-10 8:24:30.png
Did you do it the exact same way? What database are you using? Can you post your full stack trace that appears when you check the "debug" flag in the macro browser?
Regards, Felix (Scandio)
Hi Felix, more or less yes, the group query is nested in another query. {code}select user_name from cwd_user left join cwd_membership on cwd_user.id=cwd_membership.child_user_id where cwd_membership.parent_id = (select id from cwd_group where group_name=:GroupName) order by user_name asc;{code} as I actually need to get to the users of a given group. But should be the same, the result is still one row - one id that is being used further. But there is a specific thing that I didn't discover before.. it seems that it only doesn't work for one group. I have tested again a couple with spaces and worked ok, as you say. One doesn't though. After further investigation directly in DB I've found out that a couple of groups (regardles spaces in title) are stored twice!!! Same name, different IDs. What a mess:( Sorry to have bothered you, absolutely not an issue of pocket query but crowd.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, glad to hear it's nothing to do with PocketQuery. Less glad that it's a mess of course ;). If you like PocketQuery after all, would you consider leaving a review at the Atlassian Marketplace? :)
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.