I am creating a table export using data pump. Below is the code i am using to create the dump file.
dbms_datapump.add_file
(
handle => export_handle
, file_name => 'customer_x_export' -- this comes from a table
, directory => 'DUMPDIR'
, filetype => dbms_datapump.ku$_file_type_dump_file
);
dbms_datapump.add_file
(
handle => export_handle
, file_name => 'customer_x_export' -- this comes from a table
, directory => 'LOGDIR'
, filetype => dbms_datapump.ku$_file_type_log_file
);
For this the dump file created by oracle in OS is "customer_x_export.dmp" and "customer_x_export.log". Oracle adds the file extension to the supplied file name. Now i had a requirement to add version number and the given format is "customer_x.1_export". Now oracle is creating the file as "customer_x.1_export" without the extension (dmp/log). I assume as there is a dot already present in the file name oracle assumes that user has supplied the extension. The dump file name is table driven. So i was thinking if i could do something to that file name that would get me the extension. I tried to escape the dot. But it dint work.
I cant update the table to add the extension as this file name is used for both dmp and log.
Before going for a code fix to do something like
dbms_datapump.add_file
(
handle => export_handle
, file_name => 'customer_x_export' || '.dmp'
, directory => 'DUMPDIR'
, filetype => dbms_datapump.ku$_file_type_dump_file
);
Wanted to know if there is a better option.