I am trying out Confluence and PocketQuery.
I created a small Query with a parameter.
SELECT * FROM retail where customerid = 324234
customerid column is int4.
When I add a PocketSQL to a site and define the paramter I get the following StackTrace
org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [SELECT * FROM retail WHERE customerid= ?]; nested exception is org.postgresql.util.PSQLException: ERROR: operator does not exist: integer = character varying Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts
How do I tell the macro that my input is an integer?
Thank you for your help
Actually this is a SQL function. When you insert directly a number as parameter it will automatically convert to text. Try to use as follows:
SELECT * FROM retail where customerid = '324234'
More information can be found at the page below:
Hope this helps.
As Thiago already wrote correctly, this is how the underlying Spring JDBC libraries handle "Named Parameter Statements". By default, the parameters in these statements will be replaced as strings before the statement is executed. In the current public version of PocketQuery, I believe there is no workaround for this. But: we are just a few steps away from releasing PocketQuery 2.0 which has a feature for exactly this purpose. If you're interested, I will send you a release-candidate version and tell you how the feature works . In that case, please write a short mail to atlassian[at]scandio.de
Regards, Felix (Scandio)
We're kind of dependent on how the Spring JDBC libraries handle this. It's kind of more low-level than the implementation of PocketQuery. As I said, I can provide you a release candidate version via mail that has a feature by which you can specify a type for each parameter in your statement.
Most of us don’t need much convincing that stakeholder management is important. It just makes sense that keeping everyone in-the-know on projects and assigning clearly defined roles is key to having ...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs