P 2 K_PU.GET_CHILD_ID
Back to current versionRestore this version

Retrieve the ID of a date-sensitive child record#

Functionality:#

This function retrieves the ID for a date sensitive record given a parent alias and ID (and optional as of date)

Parameters:#

TABLE_ALIAS The table alias (e.g. EID) of the parent table (not the child table)
PARENT ID The ID of the parent record
AS OF Optional. Provides a date frame to retrieve the data. If it is not provided, the current system date will be used.

Returns: #

Varchar2 (even though the return value is a numeric ID)

Errors: #

** BAD Table Alias When there is no table found in IMTD with the alias provided
** No UK constraint found with ... When the table alias provided does not have a date sensitive child table
** Select failed on child table ... When a date sensitive child record could not be located as of the date specified

Example: #

p2k_pu.get_child_id('DWR',dwr_id)

will return the ID of the effective record from P2K_CM_WORK_RULE_DETAILS (the child of DWR - P2K_CM_WORK_RULES) as of today

Where this could be used is if you know the information of a header record, but now want to get something from the date-sensitive detail. You can use the combination of the P2K_PU.GC function and this function to get the column information from the child record.

For example, If I know the Work Rule (DWR) and I want to get the Standard Hours per day from the date sensitive detail, the reference would be:

 p2k_pu.gc('DWRD','STD_HOURS_PER_DAY',p2k_pu.get_child_id('DWR',dwr_id)) 

Notes#

Click to create a new notes page