Name

udt_instance_of — returns the type name of supplied type or compares two input types.

Synopsis

varchar udt_instance_of ( in udt any );
integer udt_instance_of ( in udt1 any ,
in udt2 any );

Description

This function returns information about the supplied type(s). There are two versions of this function, one returns the name of the type of the supplied argument, and the other than compares two supplied arguments for matching types. An error will be signalled if either of the types is not defined.

Parameters

udt, udt1, udt2

Varchar or type instance.

Return Types

udt_instance_of(udt) returns the fully qualified name of the type represented by the udt argument.

udt_instance_of(udt1, udt2) returns 1 (true) if udt1 is of the same type or a subtype of udt2. Otherwise it returns o (false).

Examples

Example24.428.Using udt_instance_of()

select udt_instance_of ('SER_UDT')

returns DB.DBA.SER_UDT (if the SER_UDT type was created by DBA in the DB database).

select udt_instance_of (new SER_UDT())

returns DB.DBA.SER_UDT (if the SER_UDT type was created by DBA in the DB database).

select udt_instance_of ('SER_UDT_SUB', 'SER_UDT');

Returns 1

select udt_instance_of (new SER_UDT(), 'SER_UDT_SUB');

Returns 0;