ACCUEIL >>  Technologies et Territoires >>  Laboratoire du libre >>  PL/SQL

 

pl/sql library for JSON

Monday 3 December 2007 , par Pierre-Gilles Levallois

 

Français

Here is the first release of a PL/SQL package for JSON (Javascript Simple Object Notation). This program is published under the GNU LGPL License.

The package’s features are :
- create and manipulate JSON objects
- add attributes and array to a JSON object
- convert from JSON to string
- convert from String to JSON structure
- debugging function
- customizable output (web or custom)

a little test procedure gives an idea of capabilities of this package.


The 1.1 version has released. Here the changelog between 1.0 and 1.1


- Add some stuff to prevent from javascript Hijacking, prototype framework compatible : /*-secure-\n{...json object...}\n*/
- Add procedure to send appropriate mime type for Web output "application/json"
- printing enhancement.
- suppress global variable g_output_type.
- bug corrections in String2Json func.
- Add procedure to stream out the json object
- Suppress indentation for better perf on long json objects.
- Refactor terms to match on the english terms
- bug correction in getAttrValue, add param pOutPutStringDelimiter and pOutPutSeparator that allows to format the output of the function.
- Add function getAttrArray that return an array of values in an plsql array of varchar2
- Add Array2String utility.
- Add License informations

Zip - 11 kb
PL/SQL package for JSON
1.1 stable version

The 1.0 version has released.

Zip - 8.7 kb
PL/SQL package for JSON
1.0 stable version

- Added a basic validation function to validate struture of JSON objects.



Répondre à cet article





pl/sql library for JSON

9 January 2008, par Bernard
thanks

Hello Thanks for this nice pl/sql implementation of JSON. I will evaluate if I can use this.

Remarks:
- affiche.p(p_str); is not known on my database

- there is a problem with &p_rendertype when I execute the body in sql+. You should add set define off at top of the file.

Thanks,

Bernard

    pl/sql library for JSON
    14 February 2008, par Pierre-Gilles Levallois


    - affiche.p(p_str) is my custom procedure that push out the data to the http stream. I think you should use htp.p which is the standard way using Oracle Web Toolkit, to push your results to the http stream.

    - problem of "&p_rendertype" : You’re right. I did not pass the script with Sqlplus (Sqlplus is the problem !) I use TOAD to develop packages and that’s why I did not see this problem.

    Let me know if you have some other difficulties.

    Best regards.



 



Recherche par mots clés