DOCUMENT Clause

The quoted string in the DOCUMENT clause provides a synopsis and description of the 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 of the UDRs stored in the database.

For example, the following query obtains a description of the SPL function update_by_pct, that SPL Functions shows:
SELECT data FROM sysprocbody b, sysprocedures p
WHERE b.procid = p.procid 
      --join between the two catalog tables
   AND p.procname = 'update_by_pct' 
      -- look for procedure named update_by_pct
   AND b.datakey  = 'D'-- want user document;
The preceding query returns the following text:
USAGE: Update a price by a percentage
Enter an integer percentage from 1 - 100
and a part id number

A UDR or application program can query the system catalog tables to fetch the DOCUMENT clause and display it for a user.

For C and Java™ language functions, you can include a DOCUMENT clause at the end of the CREATE FUNCTION statement, whether or not you use the END FUNCTION keywords.