This returns the rows in table1 that are not in table2.
Is this? Maybe...
PROCEDURE pcompare(result_cursor IN OUT ref cursor,table1 VARCHAR2,field1 VARCHAR2,table2 VARCHAR2,field2 VARCHAR2) IS
BEGIN
OPEN result_cursor FOR
' SELECT t1.*' ||
' FROM ' || table1|| ' t1, ' || table2 || ' t2 '
' WHERE t1.' || field1|| ' = t2.' || field2|| ' (+) and t2.' || field2|| ' is null';
END pcompare;
António Pedro Santos
Estradas de Portugal E.P.E.
----- Original Message -----
From: Adam Gould
To: LazyDBA Discussion
Sent: Wednesday, March 30, 2005 2:28 PM
Subject: a procedure to compare to fields in tables needed
hi all
I need a procedure which accepts 2 table names and 2 field names and
compares the data in both of then.
the output should be all the rows which contain different data in them
(only those, not a status).
has any one come across such a procedure before and can send it to me ?
thanks in advance
ag.
---------------------------------------------------------------------------------------------------------------
This e-mail message may contain confidential, commercial and privileged information or data that constitute proprietary information of Cellcom Israel Ltd. Any review or distribution by others is strictly prohibited. If you are not the intended recipient you are hereby notified that any use of this information or data by any other person is absolutely prohibited. If you are not the intended recipient, please delete all copies.
Thank You.
http://www.cellcom.co.il
--------
website: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com
To unsubscribe: see http://www.lazydba.com/unsubscribe.html
To subscribe: see http://www.lazydba.com
By using this list you agree to these terms:http://www.lazydba.com/legal.html
Oracle LazyDBA home page