Hi All,
I'm having trouble getting a subquery into an export. I am trying to only export data from a table based on data held in another control table and have the subquery below. Single row simple queries work fine, but as soon as i start to use subqueries it get the error message below. I scanned around various sites and i seem to be doing the same thing as most other people so i can't see why its not working. Any help/advice would be much appreciated.
I am using Release 10.2.0.3.0 on a windows environment.
declare
h1 NUMBER;
begin
h1 := dbms_datapump.open (operation => 'EXPORT', job_mode => 'TABLE', job_name => 'EXPORT000178', version => 'COMPATIBLE');
dbms_datapump.set_parallel(handle => h1, degree => 1);
dbms_datapump.add_file(handle => h1, filename => 'EXPDAT.LOG', directory => 'DIRECTORY', filetype => 3);
dbms_datapump.set_parameter(handle => h1, name => 'KEEP_MASTER', value => 0);
dbms_datapump.metadata_filter(handle => h1, name => 'SCHEMA_EXPR', value => 'IN(''DEVELOPMENT'')');
dbms_datapump.metadata_filter(handle => h1, name => 'NAME_EXPR', value => 'IN(''HISTORICDATA'', ''ARCHIVECONTROL'')');
dbms_datapump.add_file(handle => h1, filename => 'EXPDATHISTORIC.DMP', directory => 'DIRSANGHA', filetype => 1);
dbms_datapump.set_parameter(handle => h1, name => 'INCLUDE_METADATA', value => 1);
dbms_datapump.set_parameter(handle => h1, name => 'DATA_ACCESS_METHOD', value => 'AUTOMATIC');
dbms_datapump.data_filter(handle => h1, name => 'SUBQUERY', value => 'where exists (select sampleref, hist_date
from archivecontrol where HISTORICDATA.uniqueref = ARCHIVECONTROL.uniqueref)', table_name =>'HISTORICDATA');
dbms_datapump.set_parameter(handle => h1, name => 'ESTIMATE', value => 'BLOCKS');
dbms_datapump.start_job(handle => h1, skip_current => 0, abort_step => 0);
dbms_datapump.detach(handle => h1);
end;
Thanks.
G