Start of change

PTF_COVER_LETTER table function

The PTF_COVER_LETTER table function returns the cover letter content for a PTF.

The information returned is similar to what is returned by the Display PTF Cover Letter (DSPPTFCVR) command.

Authorization: See Note below.

Read syntax diagramSkip visual syntax diagram PTF_COVER_LETTER ( PTF_ID =>  ptf-id ,IGNORE_ERRORS => ignore_errors )
The schema is SYSTOOLS.
ptf-id
The PTF identifier for the cover letter to be returned.
ignore-errors
A character string that identifies what to do when an error is encountered.
NO

An error is returned.

YES
A warning is returned.
No row is returned when an error is encountered. This is the default.

The result of the function is a table containing rows with the format shown in the following table. All the columns are nullable.

Table 1. PTF_COVER_LETTER table function
Column Name Data Type Description
LINE_NUMBER INTEGER The position of this row in the PTF cover letter. The first row has a value of 1.
PTF_COVER_LETTER_LINE VARCHAR(80) The data for this row in the PTF cover letter.

Note

This function is provided in the SYSTOOLS schema as an example of how to return PTF cover letter information from a system file by using an SQL table function. Similar to other Db2® for i provided tools within SYSTOOLS, the SQL source can be extracted and used as a model for building similar helper functions, or to create a customized version within a user-specified schema.

Services provided in SYSTOOLS have authorization requirements that are determined by the interfaces used to implement the service. To understand the authority requirements, extract the SQL for the service and examine the implementation.

Example

Return cover letters for any PTFs that have been loaded but not applied.
WITH PTFS (PTF_ID) AS (
    SELECT PTFID FROM QSYS2.PTF_INFO
      WHERE PTF_COVER_LETTER = 'YES' AND 
            PTF_LOADED_STATUS = 'LOADED')
SELECT PTF_ID, C.*
  FROM PTFS, TABLE (SYSTOOLS.PTF_COVER_LETTER(PTF_ID)) C
  ORDER BY 1, 2;
End of change