I read about IS OF TYPE and I expected it to return TRUE, FALSE or NULL.
I have two types of objects:
CREATE TYPE o1 AS OBJECT ( id NUMBER ); / CREATE TYPE o2 AS OBJECT ( id NUMBER ); /
When I run the code below, everything is fine.
DECLARE type1 o1; BEGIN type1 := o1(id=>1); if (type1 IS OF (o1)) then DBMS_OUTPUT.PUT_LINE('type1 is o1'); END if; END; /
But when I try to run:
DECLARE type1 o1; BEGIN type1 := o1(id=>1); if (type1 IS OF (o2)) then DBMS_OUTPUT.PUT_LINE('type1 is o1'); END if; END; /
I got the following exceptions
Error report: ORA-06550: line 6, column 21: PLS-00382: expression is of wrong type ORA-06550: line 6, column 4: PL/SQL: Statement ignored 06550. 00000 - "line %s, column %s:\n%s" *Cause: Usually a PL/SQL compilation error. *Action:
There is no clear explanation in the documentation, should an exception be thrown if something is wrong? Or if I expect a lie in an IF condition?
source share