select to_char(call_id) as KEY,
'RolesRemoval' TEMPLATE,'en-US' LOCALE,
'TEXT' OUTPUT_FORMAT,
'WCC' DEL_CHANNEL,
'FA_UCM_PROVISIONED' PARAMETER1, /* Server Name */
'FAFusionImportExport' PARAMETER2, /* Security Group */
:xdo_user_name PARAMETER3, /* Author of the File */
'User'||to_char(call_id)||'.txt' PARAMETER5, /* Title */
'User.dat' PARAMETER6, /* Output File Name */
:TASK_INSTANCE_ID PARAMETER7, /* Comments (Optional) */
'User'||to_char(call_id) PARAMETER8, /* Content ID (Optional) If you specify the ID, it must be unique. If you don't specify the ID, the system generates a unique one. */
'FALSE' PARAMETER9 /* Custom metadata (true/false). Specify ‘false’.*/
from
(
select r.call_id
from pay_flow_task_instances fti
,pay_flow_tasks_vl ft
,pay_requests r
where ft.flow_task_name = 'Generate Data'
and ft.base_flow_task_id = fti.base_flow_task_id
and fti.flow_task_instance_id = r.flow_task_instance_id
and r.call_type= 'ESS'
and fti.flow_task_instance_id = :TASK_INSTANCE_ID
union
select 1234
from dual
where :TASK_INSTANCE_ID is null
)