$sqlstr2 holds the query in question. Is there another way to do this without first creating a dblink in one of the databases? I'd like to be able to do this on any set of databases without creating the dblink.my $sqlstr ="select table_name". " from Dba_tables". " where owner = '$schema'". " order by table_name"; my $sth=$db1->prepare($sqlstr) or print STDOUT "Query:GetDataF +ast Failed"; $sth->execute; my $table_names = $sth->fetchall_arrayref; $sth->finish; for $table_names_r (@{$table_names}) { my $sqlstr ="select column_name". " from Dba_tab_columns". " where owner = '$schema'". " and table_name = '$table_names_r->[0]'". " order by column_name"; my $sth=$db1->prepare($sqlstr) or print STDOUT "Query:GetD +ataFast Failed"; $sth->execute; my $column_names = $sth->fetchall_arrayref; $sth->finish; my $sqlstr2 ="select *". " from $schema.$table_names_r->[0]". + " MINUS". " select *". " from $schema.$table_names_r->[0]".'@'."$confi +g{database_2}"; print STDOUT "Table: $schema.$table_names_r->[0]"; my $sth2=$db1->prepare($sqlstr2) or print STDOUT "Query:Ge +tDataFast Failed"; $sth2->execute; my $results = $sth2->fetchall_arrayref; $sth2->finish;
In reply to How to Compare Data in 2 Separate Databases by timo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |