Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Using an "EXISTS" test in the QUERY parameter for an expdp

chuckersDec 16 2010 — edited Dec 16 2010
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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 13 2011
Added on Dec 16 2010
3 comments
1,625 views