ibm-information-center/dist/eclipse/plugins/i5OS.ic.sqlp_5.4.0.1/rbafyudfcfx3.htm

67 lines
4.4 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<?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="Example: String search over UDT" />
<meta name="abstract" content="Assume that you are satisfied with the FINDSTRING functions from the BLOB string search, but now you have defined a distinct type BOAT with source type BLOB." />
<meta name="description" content="Assume that you are satisfied with the FINDSTRING functions from the BLOB string search, but now you have defined a distinct type BOAT with source type BLOB." />
<meta name="DC.subject" content="examples, string search over UDT, CREATE FUNCTION statement, search string over UDT example" />
<meta name="keywords" content="examples, string search over UDT, CREATE FUNCTION statement, search string over UDT example" />
<meta name="DC.Relation" scheme="URI" content="rbafyudfdudf.htm" />
<meta name="DC.Relation" scheme="URI" content="rbafyudfcfxa.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="rbafyudfcfx3" />
<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>Example: String search over UDT</title>
</head>
<body id="rbafyudfcfx3"><a name="rbafyudfcfx3"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Example: String search over UDT</h1>
<div><p>Assume that you are satisfied with the FINDSTRING functions from
the BLOB string search, but now you have defined a distinct type BOAT with
source type BLOB. </p>
<div class="section"><p>You also want FINDSTRING to operate on values having data type
BOAT, so you create another FINDSTRING function. This function is sourced
on the FINDSTRING which operates on BLOB values. Note the further overloading
of FINDSTRING in this example:</p>
<pre> <strong>CREATE FUNCTION</strong> FINDSTRING (BOAT, <strong>VARCHAR</strong>(200))
<strong>RETURNS INT</strong>
<strong>SPECIFIC</strong> "slick_fboat"
<strong>SOURCE SPECIFIC</strong> FINDSTRING_BLOB</pre>
</div>
<div class="section"><p>Note that this FINDSTRING function has a different signature from
the FINDSTRING functions in <a href="rbafyudfcfxa.htm#rbafyudfcfxa">Example: BLOB string search</a>,
so there is no problem overloading the name. Because you are using the SOURCE
clause, you cannot use the EXTERNAL NAME clause or any of the related keywords
specifying function attributes. These attributes are taken from the source
function. Finally, observe that in identifying the source function you are
using the specific function name explicitly provided in <a href="rbafyudfcfxa.htm#rbafyudfcfxa">Example: BLOB string search</a>.
Because this is an unqualified reference, the schema in which this source
function resides must be in the function path, or the reference will not be
resolved. </p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbafyudfdudf.htm" title="A UDF must be registered in the database before the function can be recognized and used by SQL.">Register UDFs</a></div>
</div>
<div class="relref"><strong>Related reference</strong><br />
<div><a href="rbafyudfcfxa.htm" title="In this example, you want the FINDSTRING function to work on BLOBs as well as on CLOBs. To do this, you define another FINDSTRING taking BLOB as the first parameter:">Example: BLOB string search</a></div>
</div>
</div>
</body>
</html>