58 lines
3.8 KiB
HTML
58 lines
3.8 KiB
HTML
|
<?xml version="1.0" encoding="UTF-8"?>
|
||
|
<!DOCTYPE html
|
||
|
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||
|
<html lang="en-us" xml:lang="en-us">
|
||
|
<head>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||
|
<meta name="security" content="public" />
|
||
|
<meta name="Robots" content="index,follow" />
|
||
|
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
|
||
|
<meta name="DC.Type" content="reference" />
|
||
|
<meta name="DC.Title" content="Manipulate UDTs" />
|
||
|
<meta name="abstract" content="One of the most important concepts associated with UDTs is strong typing. Strong typing guarantees that only functions and operators defined on the UDT can be applied to its instances." />
|
||
|
<meta name="description" content="One of the most important concepts associated with UDTs is strong typing. Strong typing guarantees that only functions and operators defined on the UDT can be applied to its instances." />
|
||
|
<meta name="DC.subject" content="UDTs (User-defined types), manipulating, examples of, strong typing, strong typing and UDTs" />
|
||
|
<meta name="keywords" content="UDTs (User-defined types), manipulating, examples of, strong typing, strong typing and UDTs" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rbafyuddt.htm" />
|
||
|
<meta name="copyright" content="(C) Copyright IBM Corporation 1998, 2006" />
|
||
|
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 1998, 2006" />
|
||
|
<meta name="DC.Format" content="XHTML" />
|
||
|
<meta name="DC.Identifier" content="rbafymanudt" />
|
||
|
<meta name="DC.Language" content="en-us" />
|
||
|
<!-- All rights reserved. Licensed Materials Property of IBM -->
|
||
|
<!-- US Government Users Restricted Rights -->
|
||
|
<!-- Use, duplication or disclosure restricted by -->
|
||
|
<!-- GSA ADP Schedule Contract with IBM Corp. -->
|
||
|
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
|
||
|
<link rel="stylesheet" type="text/css" href="./ic.css" />
|
||
|
<title>Manipulate UDTs</title>
|
||
|
</head>
|
||
|
<body id="rbafymanudt"><a name="rbafymanudt"><!-- --></a>
|
||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
|
<h1 class="topictitle1">Manipulate UDTs</h1>
|
||
|
<div><p>One of the most important concepts associated with UDTs is <em>strong
|
||
|
typing</em>. Strong typing guarantees that only functions and operators defined
|
||
|
on the UDT can be applied to its instances.</p>
|
||
|
<div class="section"><p>Strong typing is important to ensure
|
||
|
that the instances of your UDTs are correct. For example, if you have defined
|
||
|
a function to convert US dollars to Canadian dollars according to the current
|
||
|
exchange rate, you do not want this same function to be used to convert Euros
|
||
|
to Canadian dollars because it will certainly return the wrong amount. </p>
|
||
|
</div>
|
||
|
<div class="section"><p>As a consequence of strong typing, DB2<sup>®</sup> does not allow you to write queries
|
||
|
that compare, for example, UDT instances with instances of the UDT source
|
||
|
type. For the same reason, DB2 will not let you apply functions defined on other
|
||
|
types to UDTs. If you want to compare instances of UDTs with instances of
|
||
|
another type, you need to cast the instances of one or the other type. In
|
||
|
the same sense, you need to cast the UDT instance to the type of the parameter
|
||
|
of a function that is not defined on a UDT if you want to apply this function
|
||
|
to a UDT instance.</p>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div>
|
||
|
<div class="familylinks">
|
||
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbafyuddt.htm" title="A user-defined distinct type is a mechanism that allows you to extend DB2 capabilities beyond the built-in data types available.">Use user-defined distinct types (UDT)</a></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</body>
|
||
|
</html>
|