Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

It seems to me that it should be possible to parse existing PL/SQL with the packages sys.diana and sys.pidl, but I have found nothing on the internet with the exception of a few scripts that seem to unwrap a wrapped package (and that is useless for my purposes).

So, does anyone know about a pointer into the right direction?

share|improve this question
Like you, I've only heard of the concept in regards to reverse-engineering a wrapped package. In that line, maybe a post to Pete Finnigan's security forum might find someone who has done some work in that area. – Gary Jan 28 '11 at 20:40
What is your goal in parsing the PL/SQL? – Leigh Riffel Feb 1 '11 at 5:20
I have no specific goal in mind, I just thought it'd be nice to be able to read an already parsed syntax tree. It might be handy at some time in the future for something I don't no yet. – René Nyffenegger Feb 1 '11 at 21:14
better late than never, found this presentation about reverse engineering pl/sql. – booyaa May 1 '14 at 12:22

The official documentation covering unusual errors describes DIANA:
PL/SQL is based on the programming language Ada. As a result, PL/SQL uses a variant of Descriptive Intermediate Attributed Notation for Ada (DIANA), a tree-structured intermediate language. It is defined using a meta-notation called Interface Definition Language (IDL). DIANA is used internally by compilers and other tools.

At compile time, PL/SQL source code is translated into machine-readable m-code. Both the DIANA and m-code for a procedure or package are stored in the database. At run time, they are loaded into the shared memory pool. The DIANA is used to compile dependent procedures; the m-code is simply executed.

I see why you are interested. Access to the compiler underlying PL/SQL is tantalizing if you like looking under the hood. Nonetheless I would be reluctant to invest a lot of time when the same goal can be accomplished by parsing with PL/SQL.

As someone who has used your site many times I can only thank you for having an inquiring mind.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.