5. Manage an Action File Export

Make sure that you have already created the correct export format:

6. Create an Action Export

By executing API_REDADM.ADD_APP_ACT_EXPORTS you define which object should be exportet to which file using a specific format. In addition, you may define a where-clause.

The filename may contain placeholders for

  • BDate (@{bdate})

  • application name (@{app_name})

  • RunID (@{run_id})

  • current date and timestamp (@{sysdate} and @{systimestamp})

Example

1EXECUTE SCRIPT API_REDADM.ADD_APP_ACT_EXPORTS(
2     'test_exp'                          -- p_exp_name
3     ,'test_fmt'                         -- p_fmt_name
4     ,'PSV_TEST_DR'                      -- p_obj_schema
5     ,'TEST_TAB'                         -- p_obj_name
6     ,'@{bdate}_@{app_name}_export.csv'  -- p_filename
7     ,'SYSDATE > @{bdate} - 5'           -- p_where
8);

After successfully running the code above an action export is added to the table RED_APP_ACT_EXPORTS.

EXP_NAME

FMT_NAME

OBJ_SCHEMA

OBJ_NAME

FILENAME

WHERE_CLAUSE

test_exp

test_fmt

PSV_TEST_DR

TEST_TAB

@{bdate}_@{app_name}_export.csv

SYSDATE > @{bdate} - 5

6.1. Modify an Action Export

Modify the export definition using the script API_REDADM.MODIFY_APP_ACT_EXPORTS. Providing NULL leaves the parameters as is, while a blank (’ ‘) restores the default value.

Example: modify the where-clause

1EXECUTE SCRIPT API_REDADM.MODIFY_APP_ACT_EXPORTS(
2     'test_exp'                  -- p_exp_name
3     ,null                       -- p_fmt_name
4     ,null                       -- p_obj_schema
5     ,null                       -- p_obj_name
6     ,null                       -- p_filename
7     ,'SYSDATE > @{bdate} - 3'   -- p_where
8);

After the command above is issued, the entry for the action export with the name ‘test_exp’ in the table RED_APP_ACT_EXPORTS will be changed.

EXP_NAME

FMT_NAME

OBJ_SCHEMA

OBJ_NAME

FILENAME

WHERE_CLAUSE

test_exp

test_fmt

PSV_TEST_DR

TEST_TAB

@{bdate}_@{app_name}_export.csv

SYSDATE > @{bdate} - 3

6.2. Remove an Action Export

An action export can be removed by providing its exact name to the script API_REDADM.REMOVE_APP_ACT_EXPORTS.

Example

1EXECUTE SCRIPT API_REDADM.REMOVE_APP_ACT_EXPORTS(
2    'test_exp'   -- p_exp_name
3);

After this script runs through the entry with the name ‘test_exp’ will be removed from the table RED_APP_ACT_EXPORTS.