1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
|
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
-
- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
- project.
-
- Copyright (C) 1998-2018 OpenLink Software
-
- This project is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; only version 2 of the License, dated June 1991.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
-->
<refentry id="fn_udt_instance_of">
<refmeta>
<refentrytitle>udt_instance_of</refentrytitle>
<refmiscinfo>type</refmiscinfo>
</refmeta>
<refnamediv>
<refname>udt_instance_of</refname>
<refpurpose>returns the type name of supplied type or compares two input
types.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="fsyn_udt_instance_of">
<funcprototype id="fproto_udt_instance_of">
<funcdef>varchar <function>udt_instance_of</function></funcdef>
<paramdef>in <parameter>udt</parameter> any</paramdef>
</funcprototype>
</funcsynopsis>
<funcsynopsis id="fsyn_udt_instance_of1">
<funcprototype id="fproto_udt_instance_of1">
<funcdef>integer <function>udt_instance_of</function></funcdef>
<paramdef>in <parameter>udt1</parameter> any</paramdef>
<paramdef>in <parameter>udt2</parameter> any</paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="desc_udt_instance_of">
<title>Description</title>
<para>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.</para>
</refsect1>
<refsect1 id="params_udt_instance_of">
<title>Parameters</title>
<refsect2><title>udt, udt1, udt2</title>
<para>Varchar or type instance.</para>
</refsect2>
</refsect1>
<refsect1 id="ret_udt_instance_of"><title>Return Types</title>
<para><function>udt_instance_of(udt)</function> returns the fully
qualified name of the type represented by the udt argument.</para>
<para><function>udt_instance_of(udt1, udt2)</function> returns 1 (true)
if udt1 is of the same type or a subtype of udt2. Otherwise it returns
o (false).</para>
</refsect1>
<!--
<refsect1 id="errors_udt_instance_of">
<title>Errors</title>
<para>This function can generate the following errors:</para>
<errorcode></errorcode>
</refsect1>
-->
<refsect1 id="examples_udt_instance_of">
<title>Examples</title>
<example id="ex_udt_instance_of"><title>Using udt_instance_of()</title>
<screen><![CDATA[
select udt_instance_of ('SER_UDT')
]]></screen>
<para>returns <computeroutput>DB.DBA.SER_UDT</computeroutput> (if the
<computeroutput>SER_UDT</computeroutput> type was created by DBA in the DB
database).</para>
<screen><![CDATA[
select udt_instance_of (new SER_UDT())
]]></screen>
<para>returns <computeroutput>DB.DBA.SER_UDT</computeroutput> (if the
<computeroutput>SER_UDT</computeroutput> type was created by DBA in the DB
database).</para>
<screen><![CDATA[
select udt_instance_of ('SER_UDT_SUB', 'SER_UDT');
]]></screen>
<para>Returns 1</para>
<screen><![CDATA[
select udt_instance_of (new SER_UDT(), 'SER_UDT_SUB');
]]></screen>
<para>Returns 0;</para>
</example>
</refsect1>
<refsect1 id="seealso_udt_instance_of">
<title>See Also</title>
<para><link linkend="fn_udt_get"><function>udt_get()</function></link></para>
<para><link linkend="fn_udt_defines_field"><function>udt_defines_field()</function></link></para>
<para><link linkend="fn_udt_implements_method"><function>udt_implements_method()</function></link></para>
<para><link linkend="fn_udt_set"><function>udt_set()</function></link></para>
</refsect1>
</refentry>
|