Formats a file name using replacement tokens#

Functionality:#

This function is used by selected interface functions to transform a file name provided as a parameter in the launch screen to have various aspects substituted.

Parameters:#

FILE_NAME The file name that is entered as the parameter
MEX_ID The execution ID of the process that is creating the file
OTHER_TRANSFORM Optional. Identifies any other single transformation you want

Operation#

If the FILE_NAME parameter contains any of the keywords below (case insensitive), the keyword will be replaced as noted. In addition to these provided keywords, the program can also allow for an additional transformation by providing a keyword / value pair (separated by an equals sign) in the third parameter.
KeywordIs replaced in the File Name by
MEX The execution ID (second parameter)
DATE The current system date in YYYYMMDD format
TIME The current system time in HHMMSS format (the format model is 24 hours - HH24MISS)
Other One more subsequent transformation can be applied in a string/value pair seperated by an equals sign (see examples below).
The calling program would have to be conditioned to support this

Returns: #

Varchar2

Errors: #

None

Examples#

  • File Name parameter is extractDATE-TIME_MEX.csv and Execution is 7531:
    • The file name returned with a call to P2K_PU.FILE_NAME(p_file_name,v_mex_id) would return extract20110928-151722_7531.csv
  • File Name parameter is depDATE_FILE.txt
    • Using the third parameter in this function, the program can replace the keyword FILE with a file creation number
    • P2K_PU.FILE_NAME(p_file_name,v_mex_id,'FILE='||v_file_creation_number)
    • Subsequent file name may be dep20110814_12211.txt