New object instantiation semantic since 9.2.0.1

From implicit cursors

example:

create TYPE TMyObject as object (
   N1 NUMBER,
   V1 VARCHAR2(256),
   V2 VARCHAR2(256),
   N2 NUMBER,
   N3 NUMBER);

 

CREATE TABLE TMP_TABLE
(
   N1 NUMBER,
   V1 VARCHAR2(256),
   V2 VARCHAR2(256),
   N2 NUMBER,
   N3 NUMBER);

 

This works for previous version of 9.2.0.1

create or replace procedure p_workaround  is
    v TMyObject ;
begin
  FOR r IN
          (SELECT t.n1, t.v1, t.v2, t.n2, t.n3
             FROM TMP_TABLE t)
      LOOP
            v := r;
      END LOOP;
end;

 

Since 9.2.0.1 compiling the above procedure produce the error:

PLS-00382: expression is of wrong type

With the new semantic rules the above procedure is

create or replace procedure p_workaround  is
    v TMyObject ;
begin
  FOR r IN
          (SELECT t.n1, t.v1, t.v2, t.n2, t.n3
             FROM TMP_TABLE t)
  LOOP
  	v := TMyObject(r.n1, r.v1, r.v2, r.n2, r.n3);
  END LOOP;
end;