PL/JSON v0.6 Released to SourceForge
PL/JSON v0.6.1 has now been released to Sourceforge.net. The reason for the .1 is that I forgot a dependency on the 0.6 release.
Anyway, PL/JSON can now create JSON via the API or through parsing a text string. The parser is implemented as a stand along package. That means you can write your own parser (or use an external procedure) if you don’t like mine. This will make it very extensible. I also plan to add PL/SQL callbacks to the parser at some point for custom processing.
Example of parsing:
SET SERVEROUTPUT ON
DECLARE
v_json json;
v_json2 VARCHAR2(32000) :=
'{
"abc": "dpkxvdvvcxz\"vxasasa ",
"def": 12345,
"ghi":{"isit":true, "nope":false,"denada":true },
"jkl": [1234, 45678.99, 121211, 21323232, 00000]
}';
BEGIN
v_json := json(v_json2);
v_json.print;
END;
/
{
"abc":"dpkxvdvvcxz\"vxasasa ",
"def":12345,
"ghi":{
"isit":true,
"nope":false,
"denada":true}
,
"jkl":[1234,45678.99,121211,21323232,0]}
Output from PL/JSON checks out on JSONLint. That means you can now use the JSON data type as the return from a web service call (say as the return from ORA_TWEET). This release makes PL/JSON MUCH more useful. It’s not perfect yet (of course) but it is usable at this point.
The download includes a test script that includes 9 different JSON text strings of varying complexity. It also includes a test script for creating JSON via the API.
Roadmap for the future:
- 0.7 – Add JSONPath (or a subset) to allow extracting individual nodes of data
- 0.7.5 – Add insert, update and delete for nodes
- 0.8 – Parse XML and convert to JSON
- 0.9 – Convert JSON to XML
- 1.0 – Initial stable release with full documentation
I have no time lines for these. I work on it as I have time available. I’d like to have a version 1.0 by the end of the year though.
Send me any bugs, comments, ideas, etc and I will work them into my to do list.
LewisC
You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.




Hello. Your 0.6.1 install script is broken. There are several “exit” commands in the scripts you call, which causes sqlplus to exit prematurly. Also, on the string_handler package, the printf functino has a “create or replace” clause which cause both the spec and body to fail. Fixing these errors manually make the trick though.
Regards,
Jose.
Ack. Thanks. I’ll make those updates and get a new version out.
LewisC
Have looked at: http://reseau.erasme.org/Librairie-JSON on the http://www.json.org/ site?
It’s a very complete PL/SQL package.
Regards,
Learco