Has anyone successfully used EXISTS in the QUERY parm during an export datapump? I can get IN to work, but not exists:
Works:
tables=fred.export1
directory=dpump_dir_dev
dumpfile=expdpdev_export_test2_20101216.dmp
logfile=expdpdev_export_test2_20101216.log
query=export1:"WHERE state in (select state from fred.export2)"
Doesn't work
tables=fred.export1
directory=dpump_dir_dev
dumpfile=expdpdev_export_test4_20101216.dmp
logfile=expdpdev_export_test4_20101216.log
query=export1:"WHERE exists (select * from fred.export2 where fred.export2.state = fred.export1.state)"
Oracle unhappy:
. . .
Processing object type TABLE_EXPORT/TABLE/TABLE
ORA-31693: Table data object "FRED"."EXPORT1" failed to load/unload and is being skipped due to error:
ORA-00904: "FRED"."EXPORT1"."STATE": invalid identifier
. . .
I tried "where export2.state = export1.state)" and that returned the same error
It's like Oracle is aliasing the table or something, such that when I try to reference it in the WHERE clause of the subquery, it can't recognize it. Any ideas on another way of writing the EXISTS test? I can use IN, but in some cases that might be a list of values over 500,000 items long. Looks like an EXISTS runs faster as a SELECT statement, so I thought the same might be true during the datapump process.
--=Chuck