views:

1757

answers:

6

Are there any good PL/SQL libraries for JSON that you've worked with and found useful?

In PL/SQL, I'm having to tediously hand code the return of JSON values to JavaScript functions. I found one PL/SQL library for auto-generating JSON, but it doesn't do exactly everything I need it too. For example, I couldn't extend the base functions in the library to return a complex tree-like JSON data structure required by a JavaScript tree component I was using.

Note:
The system, which has been in production for 8+ years, was architected to use PL/SQL for the CRUDs and most of the business logic. The PL/SQL also generates 90% of the presentation layer (HTML/JavaScript), using mod PL/SQL. The other 10% is report data done via Oracle Reports Builder.

+1  A: 

I wonder why you don't want to bring the data from Oracle into some application code and make JSON there?

Geoff
A: 

@Geoff-

The system, which has been in production for 8+ years, was architected to use PL/SQL for the CRUDs and most of the business logic. The PL/SQL also generates 90% of the presentation layer (HTML/JavaScript), using mod PL/SQL. The other 10% is report data done via Oracle Reports Builder.

So, there isn't application code like you'd see in more modern, better architected systems. I do want to do things the right way, I just don't have that luxury given organizational constraints.

happyappa
A: 

Ouch - generating your interface in PL/SQL. You have my sympathy.

I've never done anything like this, but Googling found this page (which is also referenced from the json.org page).

Neall
"generating your interface in PL/SQL. You have my sympathy."... obviously you have never heard about Oracle Application Express (http://apex.oracle.com)... ?
ObiWanKenobi
A: 

@Neall-

Appreciate you searching, thanks. I had that erasme link included in my question, but it's hidden as a link. I actually thought it might do the trick at first, but I couldn't get it to do that tree that I needed...so I ended up putting that library to the side.

Yeah, about the interface, when I first started this job, my eyes barfed.

happyappa
You should reply directly to their comments instead of posting an answer.
cdmckay
You should know that comments were not available in Stackoverflow at that time. But thanks for the tip!
happyappa
A: 

How did you solve this?

I'm looking for the same thing I believe.

+2  A: 

Check out PL/JSON. You can see it at http://oracleoss.com/

It's at version 0.5 right now. It can generate JSON but not read it. I'm writing the parser and it will be added before v1.0.

LewisC http://database-geek.com