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.
- 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.
The result of the function is a table containing rows with the format shown in the following table. All the columns are nullable.
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
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;