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

78 lines
5.3 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="Pass arguments from DB2 to external functions" />
<meta name="abstract" content="DB2 provides storage for all parameters passed to a UDF. Therefore, parameters are passed to the external function by address." />
<meta name="description" content="DB2 provides storage for all parameters passed to a UDF. Therefore, parameters are passed to the external function by address." />
<meta name="DC.Relation" scheme="URI" content="rbafywudfextern.htm" />
<meta name="DC.Relation" scheme="URI" content="rbafyparamsql.htm" />
<meta name="DC.Relation" scheme="URI" content="rbafyparamdb2sql.htm" />
<meta name="DC.Relation" scheme="URI" content="rbafyparamgen.htm" />
<meta name="DC.Relation" scheme="URI" content="rbafyparamgennull.htm" />
<meta name="DC.Relation" scheme="URI" content="rbafyparamdb2gen.htm" />
<meta name="DC.Relation" scheme="URI" content="rbafyparamjava.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="rbafypassarguments" />
<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>Pass arguments from DB2 to external functions</title>
</head>
<body id="rbafypassarguments"><a name="rbafypassarguments"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Pass arguments from DB2 to external functions</h1>
<div><p>DB2<sup>®</sup> provides
storage for all parameters passed to a UDF. Therefore, parameters are passed
to the external function by address. </p>
<div class="section"><p>This is the normal parameter passing method for programs. For
service programs, ensure that the parameters are defined correctly in the
function code. </p>
</div>
<div class="section"><p>When defining and using the parameters in the UDF, care should
be taken to ensure that no more storage is referenced for a given parameter
than is defined for that parameter. The parameters are all stored in the same
space and exceeding a given parameter's storage space can overwrite another
parameter's value. This, in turn, can cause the function to see invalid input
data or cause the value returned to the database to be invalid. </p>
</div>
<div class="section"><p>There are several supported parameter styles available to external
UDFs. For the most part, the styles differ in how many parameters are passed
to the external program or service program.</p>
</div>
</div>
<div>
<ul class="ullinks">
<li class="ulchildlink"><strong><a href="rbafyparamsql.htm">Parameter style SQL</a></strong><br />
The parameter style SQL conforms to the industry standard Structured Query Language (SQL). This parameter style can only be used with scalar UDFs.</li>
<li class="ulchildlink"><strong><a href="rbafyparamdb2sql.htm">Parameter style DB2SQL</a></strong><br />
With the DB2SQL parameter style, the same parameters and same order of parameters are passed into the external program or service program as are passed in for parameter style SQL. However, DB2SQL allows additional optional parameters to be passed along as well.</li>
<li class="ulchildlink"><strong><a href="rbafyparamgen.htm">Parameter style GENERAL (or SIMPLE CALL)</a></strong><br />
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.</li>
<li class="ulchildlink"><strong><a href="rbafyparamgennull.htm">Parameter style GENERAL WITH NULLS</a></strong><br />
The parameter style GENERAL WITH NULLS can only be used with scalar UDFs.</li>
<li class="ulchildlink"><strong><a href="rbafyparamdb2gen.htm">Parameter style DB2GENERAL</a></strong><br />
Parameter style DB2GENERAL is used by Java™ UDFs. </li>
<li class="ulchildlink"><strong><a href="rbafyparamjava.htm">Parameter style Java</a></strong><br />
The Java™ parameter style is the style specified by the SQLJ
Part 1: SQL Routines standard.</li>
</ul>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbafywudfextern.htm" title="You can write the executable code of a UDF in a language other than SQL.">Write UDFs as external functions</a></div>
</div>
</div>
</body>
</html>