I created a db link successfully. Then I used a "Select count(*) from test_table@db_link" to query how many records. It returned "400". Then I queried the table "test_table" at the local database using "select count(*) from test_table". It returned "385". So far, both are correct. However, I want to find all records in "test_table@db_link", which does not exist in the "test_table" in the local db. I created the following view:
CREATE OR REPLACE VIEW record_diff
AS
SELECT a.ID, a.name
FROM test_table@db_link a, test_table b
WHERE a.ID <> b.ID
Please note that the two table structures are exactly the same, and both of them contain many of exactly same records.
Unfortunately, this view does not return the correct data. Instead, it returns a cartesian product. What may be wrong with this view?
Thanks.
Fox12
CREATE OR REPLACE VIEW record_diff
AS
SELECT a.ID, a.name
FROM test_table@db_link a, test_table b
WHERE a.ID <> b.ID
Please note that the two table structures are exactly the same, and both of them contain many of exactly same records.
Unfortunately, this view does not return the correct data. Instead, it returns a cartesian product. What may be wrong with this view?
Thanks.
Fox12