Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Quick compare of PL/SQL records
On 04/29/2005 09:23:41 AM, Ranko Mosic wrote:
> Yes, I know what manual says - that's why I am posting the question here.=
=3D
> =3D20
> The thing is, I need to compare about 100 types of records with dozens of=
=3D
> =3D20
> attributes each. I would like to be able to avoid field level
> comparison and do it
> on record level.
> rm=3D20
Ranko, I am afraid that this isn't possible, not even in 10g which has some=
thing called
"aggregate asignment", but it still lacks aggregate comparison. You can do =
it if you=20
(Gawd, this is so hard to say!) use Java in the database instead of PL/SQL.=
Here is
a little example which DOESN'T work:
declare
cursor csr is select * from emp1;
behead csr%rowtype;
begin
select * into behead from emp where ename=3D'KING';
for c in csr
loop
if (c=3Dbehead) then
dbms_out.put_line('Got it!');
end if;
end loop;
end;
/
if (behead=3Dc) then
*
ERROR at line 8:
ORA-06550: line 8, column 11: PLS-00306: wrong number or types of arguments in call to '=3D' ORA-06550: line 8, column 1:
Wrong types of arguments in call to '=3D'. Abandon all hope ye who enter he= re.
--=20
Mladen Gogala
Oracle DBA
-- http://www.freelists.org/webpage/oracle-lReceived on Fri Apr 29 2005 - 10:11:22 CDT