-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhancements #1
Enhancements #1
Conversation
new output method to_string for small arrays.
Dear @matthias-oe! Thank you for your pull request! I have used your suggestion and added an API for parsing json strings representing an array and released the code in 0.2.0. It is now possible to construct a json_array and a json_value from a string. I'm still investigating your pull request with the new to_string method for small objects but it currently seems as if there would be no actual performance improvement. |
Dear @doberkofler thanks you for considering my request. The new parsing API looks great! Let me try to explain my ambition to introduce the to_string method: Here is a small example: CREATE OR REPLACE FUNCTION Test ojson := JSON_Object(); RETURN ajson.to_string; |
Dear @matthias-oe I would generally recommend also using the CLOB type in Java to make sure that there is no overflow. The Oracle JVM does support CLOB as a legal datatype mapping to oracle.sql.CLOB and this would make sure that you never again have to care for an overflow. Alternatively you should be able to simply return the CLOB in your example and ORacle would automatically covert it to a varchar2:
|
Dear doberkofler, we are using Java in Web-Environments specified by our customers and we want to avoid proprietary datatypes... Actually the to_clob method seems to be a bit unhandy: dbms_lob.createtemporary(aLob, TRUE); I tried to hide this in the to_string method. Anyway, thanks for your great PLSQL-JSON library! Yours sincerely Von: Dieter Oberkofler [mailto:[email protected]] Dear @matthias-oe |
we needed the ability to work with JSON-arrays generated and consumed by google-gson (A Java library to convert JSON to Java objects and vice-versa) in stored procedures, so we decided to enhance the json_array type.
As we handle small objects we added the "to_string" method to the json_array and json_object to encapsulate the CLOB-handling, but we are not sure about "the right" way to avoid invalid return values.