'DBMS_DATAPUMP API export/import tables from different schemas

I would like to export import tables from multiple schemas with DBMS_DATAPUMP API. EG user1.table1 user2.table2 user3.table3 I give in a parameter the tables like a list with comma separated. 'user1.table1,user2.table2,user3.table3' After that I store in a table the list of tables. Then I read in a cursor the content of the table and go through in the cursor with a LOOP and give the schemas and table names one by one.

LOOP
 dbms_datapump.metadata_filter(handle => h1, name => 'NAME_EXPR', value => 'IN('table1'));
 dbms_datapump.metadata_filter(handle => h1, name => 'SCHEMA_LIST', value => 'IN('user1'));
END LOOP.

The first table is successfully added to the dbms_datapump job, but the second table exit with error.

ORA-39071: Value of SCHEMA_LIST is badly formed. ORA-00936: missing exprension

I tired to find solutions how to exp/imp with DBMS_DATAPUMP API tables from different schemas but I have found any examples. The examples whih I found only shows if you are exp/imp from one schema. Thanks in advance



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source