.net - Nested queries from multiple Oracle databases -
in .net, possible run nested query 2 separate oracle databases?
e.g.
"select my_value, table_in_database_1 my_value in ( select my_value table_in_database_2 )"
if so, how go doing this?
ultimately, effort overcome "ora-01795" error using "in" statement on 1000 items in conditional list, without having break query out multiple "or value in" lists.
you might able away building database link , joining on link, can have performance issues. this:
build link database 2 on database 1.
create database link db2 connect user identified pw using tns-alias;
join table on database 1 table on database 2:
select my_value table_in_database_1 t1 join table_in_database_2@db2 t2 on t1.my_value = t2.my_value
depending on performance of link, may opt use hybrid approach this, involving both database link , temporary table.
build database link above. build temporary table on database 1 holds values used in subquery database 2.
create global temporary table db2_values (value varchar2(20));
copy values db2 db1:
insert db2_values select my_value table_in_database_2@db2;
finally, join database 1 table temporary table.
select my_value table_in_database_1 t1 join db2_values t2 on t1.my_value = t2.value;
Comments
Post a Comment