DOCUMENT Clause

The quoted string in the DOCUMENT clause provides a synopsis and description of a UDR. The string is stored in the sysprocbody system catalog table and is intended for the user of the UDR.

Anyone with access to the database can query the sysprocbody system catalog table to obtain a description of one or all the UDRs stored in the database. A UDR or application program can query the system catalog tables to fetch the DOCUMENT clause and display it for a user.

For example, to find the description of the SPL procedure raise_prices, shown in SPL Procedures, enter a query such as this example:
SELECT data FROM sysprocbody b, sysprocedures p
WHERE b.procid = p.procid 
      --join between the two catalog tables
   AND p.procname = 'raise_prices' 
      -- look for procedure named raise_prices
   AND b.datakey  = 'D';-- want user document
The preceding query returns the following text:
USAGE: EXECUTE PROCEDURE raise_prices( xxx )
xxx = percentage from 1 - 100 

For external procedures, you can use a DOCUMENT clause at the end of the CREATE PROCEDURE statement, whether or not you use the END PROCEDURE keywords.