Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Can I compare records in PLSQL?
Does anyone know how I can compare 2 records in a table? In my Forms
6.0 application I am calling a external application which may (or may
not) alter a record's data. I need to be able to compare the record's
data from before and after the call to the external application. I've
tried the following PL/SQL:
DECLARE
CURSOR curBefore IS
SELECT * FROM MyTable
WHERE id = 10;
curBeforeRec curBefore%ROWTYPE;
CURSOR curAfter IS
SELECT * FROM MyTable
WHERE id = 10;
curAfterRec curAfter%ROWTYPE;
BEGIN
OPEN curBefore;
FETCH curBefore INTO curBeforeRec;
CLOSE curBefore;
--Call external application...might amend this record's data!
OPEN curAfter;
FETCH curAfter INTO curAfterRec;
CLOSE curAfter;
IF curBeforeRec = curAfterRec THEN
MESSAGE('They are the same!');
ELSE
MESSAGE('They are different!');
END IF;
END;
However, this doesn't compile - I get the message "wrong number or
types of arguments in call to '='"for the "IF curBeforeRec = ..." line.
I could compare the record column by column but the table in question has at least 200 columns and is often having columns added or removed which would make a column-by-column comparison difficult.
Anyone any ideas?
Neil W. Garside (Brisbane, Australia)
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
Received on Thu Sep 16 1999 - 00:26:32 CDT
![]() |
![]() |