« Process Flow - Execute a map for all files in a directory - Part 2 | Main | Publishing Process Flow as a Web Service »

Dynamically generating target file names

A little known fact is how to dynamically create a file name for a map that has a file as a target (for example). The configuration property 'Target Data File Name' allows a data file name to be entered, it is actually possible to insert a PLSQL expression here given the correct formatting. This let's you define any valid PLSQL expression, so you could add a date to a file name for example.

In the example below  append the SYSDATE to the string 'orders' and this is the name of my file (a file name such as 'orders05-JUL-07' will be written).

Map File Target:

The generated code will be like the following snippet with the expression
being evaluated in PLSQL:

   

        "ORDERS_FILE_Fh" := UTL_FILE.FOPEN(

          'ITD_FILES_LOCATION1',

          'orders'||sysdate||'',

          'w',

          32767);



Basically the file name you type will be wrapped in single quotes, so
if you use quotes in your expression which end up with a valid PLSQL
expression you can do what you want.

TrackBack

TrackBack URL for this entry:
http://blogs.oracle.com/mt/mt-tb.cgi/2199

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)