6

Oracle SQL Developer (I'm using v3.2) has a feature called "DB Doc", which generates documentation for database objects. I mostly want to use it to generate documentation for my stored procedures, functions, packages and types. However, I can't find any documentation for it, describing what syntax I should use.

I have worked out that I should use a /* ... */ comment on the line(s) immediately above my procedure/whatever, and (by borrowing from JavaDoc) I have successfully used @param and @returns statements, but I'm not sure what else I can use. For example, are there fields for author, version, data modified, etc.?

I've done numerous searches of this site, Google, and Oracle's documentation, to no avail!

asked Oct 16, 2012 at 14:56
1

2 Answers 2

3

Community wiki answer initially based on comments left by thatjeffsmith:

This is an exhaustive list of what it supports:

(reproduced from http://pldoc.sourceforge.net/maven-site/samples/sample1.sql)

CREATE OR REPLACE
PACKAGE CUSTOMER_DATA
IS
/** 
* Project: Test Project (<a href="http://pldoc.sourceforge.net">PLDoc</a>)<br/>
* Description: Customer Data Management<br/>
* DB impact: YES<br/>
* Commit inside: NO<br/>
* Rollback inside: NO<br/>
* @headcom
*/
/**
* Record of customer data.
*
* @param id customer ID
* @param name customer name
* @param regno registration number or SSN
* @param language preferred language
*/
TYPE customer_type IS RECORD (
 id VARCHAR2(20),
 name VARCHAR2(100),
 regno VARCHAR2(50),
 language VARCHAR2(10)
);
/** Table of customer records. */
TYPE customer_table IS TABLE OF customer_type INDEX BY BINARY_INTEGER;
/**
* Gets customer by ID.
*
* @param p_id customer ID
* @param r record of customer data
* @throws no_data_found if no such customer exists
*/
PROCEDURE get_customer (
 p_id VARCHAR2,
 customer_rec OUT customer_type);
/**
* Searches customer by criteria.
*
* @param p_criteria record with assigned search criteria
* @param r_records table of found customers <b>(may be empty!)</b>
*/
PROCEDURE get_by_criteria (
 p_criteria customer_type,
 r_records OUT customer_table);
/**
* Creates a customer record.
*
* @param customer_rec record of customer data
*/
PROCEDURE create_customer (
 customer_rec customer_type);
/**
* Changes customer data.
*
* @param customer_rec record of updated customer data
*/
PROCEDURE update_customer (
 customer_rec customer_type);
END;
/

We support everything in PLDOC - we just have a GUI vs a CLI for it. There are three code samples there, you should be able to do anything listed in those samples.

-1

I would recommend to use PLDOC for PLSQL Documentation generation. It's similar to JavaDoc (slightly limited functionality, but has basics like @return, @throw, @param and etc.).

answered Nov 30, 2015 at 20:13
1
  • I agree, but this isn't really an answer to my question - @thatjeffsmith did that in a comment above. Commented Nov 30, 2015 at 20:15

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.