Retrieve any column from any table#
Functionality:#
This function retrieves a column value from a tableParameters:#
TABLE_NAME | Either the full table name (e.g. P2K_HR_IDENTITIES) or the table alias (e.g. EID) |
COLUMN_NAME | The column name from that table that you wish to retrieve |
REFERENCE_ID | The ID of the record that you are seeking the data for |
Returns: #
Varchar2 (regardless of the type of data being requested)Errors: #
*bad table name* | When there is no table found in IMTD with the name, or alias provided |
*bad column name* | When there is no column name found in IMCD with that name, for the table provided. |
*error: invalid column length* | When the column is a BLOB, or has a maximum length in excess of 4,000 characters |
*error: ORA-xxx | is issued when any other error occurs. |
Example: #
P2K_PU.GC('EID','FIRST_NAME',~) - Using Identity ID as the third parameter (~)
- Will return the First Name the employee from P2K_HR_IDENTITIES, identified by the ID in the third parameter
P2K_PU.GC('P2K_PR_PAY_RUNS','DISBURSED',~) - Using Pay Run ID as the third parameter (~)
- Will return the DISBURSED flag, for the payrun identified by the ID in the third parameter
Note that DATE field types will return the date as a character in DD-MON-YYYY format, so if you want to reformat using a date format mask, then you will need to convert to a date type using the TO_DATE function.