How to fix the Oracle error ORA-22341: cannot assign supertype instance to subtype?

In this post, you’ll learn more about the Oracle ErrorORA-22341: cannot assign supertype instance to subtype with the details on why you receive this error and the possible solution to fix it.

Oracle Error Description

ORA-22341: cannot assign supertype instance to subtype

Reason for the Error ORA-22341: cannot assign supertype instance to subtype

An attempt was made to assign or copy a supertype instance to a container (destination) that can only hold a subtype instance.

How to fix the Error ORA-22341: cannot assign supertype instance to subtype ?

You can fix this error in Oracle by following the below steps

Make sure the runtime type of the source of the assignment or copy is the same type as the destination or is a subtype of the destination type