How do i use DBMS_METADATA.SET_FILTER to exclude all TMP_ tables except TMP_BAR?

230 Views Asked by At

I am using dbms_metadata to extract the objects of a schema and to filter all tables whose names start with either TEMP_ or TMP_:

dbms_metadata.set_filter(exp_h, 'NAME_EXPR', q'[not like 'TEMP_%' ESCAPE '\']', 'TABLE');
dbms_metadata.set_filter(exp_h, 'NAME_EXPR', q'[not like 'TMP_%'  ESCAPE '\']', 'TABLE');

This worked without a problem. However, there is now one TMP_ table, (say TMP_BAR) which must not be excluded. I am not sure how I can extend my script to explicitely include this table to the set of exported objects.

1

There are 1 best solutions below

0
On

Try using this -

dbms_metadata.set_filter(exp_h, 'NAME_EXPR', q'[= 'TMP_BAR' OR 'TABLE' NOT like 'TMP_%' ESCAPE '\']', 'TABLE');