74 lines
5.1 KiB
HTML
74 lines
5.1 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="Parameter style GENERAL (or SIMPLE CALL)" />
|
||
<meta name="abstract" content="With parameter style GENERAL, the parameters are passed into the external service program just as they are specified in the CREATE FUNCTION statement. This parameter style can only be used with scalar UDFs." />
|
||
<meta name="description" content="With parameter style GENERAL, the parameters are passed into the external service program just as they are specified in the CREATE FUNCTION statement. This parameter style can only be used with scalar UDFs." />
|
||
<meta name="DC.subject" content="UDFs (User-defined functions), parameter style GENERAL, parameter style SIMPLE CALL, passing SQL-argument, passing SQL-result, RETURNS TABLE clause, CAST FROM clause" />
|
||
<meta name="keywords" content="UDFs (User-defined functions), parameter style GENERAL, parameter style SIMPLE CALL, passing SQL-argument, passing SQL-result, RETURNS TABLE clause, CAST FROM clause" />
|
||
<meta name="DC.Relation" scheme="URI" content="rbafypassarguments.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="rbafyparamgen" />
|
||
<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>Parameter style GENERAL (or SIMPLE CALL)</title>
|
||
</head>
|
||
<body id="rbafyparamgen"><a name="rbafyparamgen"><!-- --></a>
|
||
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
<h1 class="topictitle1">Parameter style GENERAL (or SIMPLE CALL)</h1>
|
||
<div><p>With parameter style GENERAL, the parameters are passed into the
|
||
external service program just as they are specified in the CREATE FUNCTION
|
||
statement. This parameter style can only be used with scalar UDFs.</p>
|
||
<div class="section"><p>The format is:</p>
|
||
</div>
|
||
<div class="section"> <pre><span><img src="./c.gif" border="0" alt="Read syntax diagram" longdesc="rbafyparamgensyn1.htm" /></span><a href="#d0e40"><img src="./c.gif" border="0" alt="Skip visual syntax diagram" /></a>
|
||
.------------------.
|
||
V |
|
||
>>-SQL-result = func--(----+--------------+-+--)---------------><
|
||
'-<i>SQL-argument</i>-'
|
||
|
||
</pre><a name="d0e40"></a></div>
|
||
<div class="section"> <dl><dt class="dlterm"><em>SQL-argument</em></dt>
|
||
<dd>This argument is set by DB2<sup>®</sup> before calling the UDF. This value repeats <em>n</em> times,
|
||
where <em>n</em> is the number of arguments specified in the function reference.
|
||
The value of each of these arguments is taken from the expression specified
|
||
in the function invocation. It is expressed in the data type of the defined
|
||
parameter in the CREATE FUNCTION statement. Note: These parameters are treated
|
||
as input only; any changes to the parameter values made by the UDF are ignored
|
||
by DB2.</dd>
|
||
<dt class="dlterm"><em>SQL-result</em></dt>
|
||
<dd>This value is returned by the UDF. DB2 copies the value into database storage.
|
||
In order to return the value correctly, the function code must be a value-returning
|
||
function. The database copies only as much of the value as defined for the
|
||
return value as specified on the CREATE FUNCTION statement. If the CAST FROM
|
||
clause is used in the CREATE FUNCTION statement, DB2 assumes the UDF returns the value as
|
||
defined in the CAST FROM clause, otherwise DB2 assumes the UDF returns the value as
|
||
defined in the RETURNS clause. <p>Because of the requirement that the function
|
||
code be a value-returning function, any function code used for parameter style
|
||
GENERAL must be created into a service program.</p>
|
||
</dd>
|
||
</dl>
|
||
</div>
|
||
</div>
|
||
<div>
|
||
<div class="familylinks">
|
||
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbafypassarguments.htm" title="DB2 provides storage for all parameters passed to a UDF. Therefore, parameters are passed to the external function by address.">Pass arguments from DB2 to external functions</a></div>
|
||
</div>
|
||
</div>
|
||
</body>
|
||
</html>
|