[Documentation] Enhance Documentation for Querying Multiple Parameters in Java API #159
Replies: 5 comments
-
Hi @otaviojava When having multiple variables, you need to use So the good query is
Otherwise, the goal of preparedStatement is to Parse one and execute many; I will provide you with a better example. Concerning your request. I will create an internal ticket for an update of the doc. Provide examples with multiple parameters when using the SDK and not with only one parameter. Dario |
Beta Was this translation helpful? Give feedback.
-
When retrieving data, I recommend to read this GitHub discussion: #50 |
Beta Was this translation helpful? Give feedback.
-
@otaviojava Thanks for providing the feedback to improve the documentation on examples of performing queries with multiple parameters using the Java API. We are already working on this - to revise and enhance all the existing examples for using different SDKs to do various database operations. We will be publishing the updated docs for this soon! |
Beta Was this translation helpful? Give feedback.
-
We also support positional binding and the following syntax if you prefer
I will provide more insights into the difference between the two possibilities later - trade-offs |
Beta Was this translation helpful? Give feedback.
-
Hi @otaviojava An important extract from the documentation of PreparedStatement
The idea is to parse only one time and execute multiple times.
|
Beta Was this translation helpful? Give feedback.
-
I use the Oracle NoSQL Database and perform queries with multiple parameters using the Java API. However, I have encountered some issues with the provided code snippets in the documentation.
Problem:
The Oracle NoSQL Database documentation suggests using the following code snippet to prepare and execute a query with multiple parameters:
When attempting to use this code with the following query:
Issue 1:
The code throws an exception:
java.lang.IllegalArgumentException: PREPARE: Illegal Argument: Error: at (1, 20) no viable alternative at input 'DECLARE$ageINTEGER,', at line 1:20
.Issue 2:
When I modify the query to:
The code throws another exception:
java.lang.IllegalArgumentException: PREPARE: Illegal Argument: Error: at (1, 30) missing '(' at '$type', at line 1:30
.Request:
I request the Oracle NoSQL Database documentation team to provide more detailed and accurate examples of performing queries with multiple parameters using the Java API. Specifically addressing the issues mentioned above and ensuring that the code snippets align with the syntax and usage of the Oracle NoSQL Database.
Documentation Reference:
The reference used for this query is: Oracle NoSQL Database Documentation
The table structure
I appreciate your assistance in improving the documentation to make it more user-friendly and accurate. Thank you!
Beta Was this translation helpful? Give feedback.
All reactions