<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="mmres://user_interface_reference.css" rel="stylesheet" type="text/css">
<title>CFPROCPARAM</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
   <div id="説明">
   <table cellpadding="0" cellspacing="0" border="0" width="100%" class="main">
      <tr> 
         <td valign="top" class="name">CFPROCPARAM</td>
         <td valign="top" nowrap class="compatibility">&nbsp;</td>
      </tr>
      <tr>
         <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
      </tr>


    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">説明</span>
<p>
ストアードプロシージャのパラメータを定義します。このタグは、cfstoredproc タグ内にネストします。 
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">カテゴリ</span>
<p>
データベース操作タグ
</p>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="syntax"><span class="title">シンタックス</span><pre>&lt;cfprocparam
   type = &quot;in&quot;、&quot;out&quot;、&quot;inout&quot;
   variable = &quot;variable name&quot;
   value = &quot;parameter value&quot;
   CFSQLType = &quot;parameter datatype&quot;
   maxLength = &quot;length&quot;
   scale = &quot;decimal places&quot; 
   null = &quot;yes&quot;、&quot;no&quot;&gt;
</pre>    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">関連項目</span>
<p>
cfinsert、cfprocresult、cfquery、cfqueryparam、cfstoredproc、cftransaction、cfupdate、『ColdFusion MX 開発ガイド』の第13章の「ColdFusion アプリケーションの設計と最適化」 の「ColdFusion アプリケーションの最適化」
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">ヒストリ</span>
<p>
ColdFusion&#160;MX: 
</p>
<ul>

<li>maxrows 属性は廃止されました。 </li>

<li>dbvarname 属性の動作が変更されました。すべてのドライバで無視されるようになりました。ColdFusion MX では JDBC 2.2 が使用され、名前付きパラメータはサポートされません。</li>

<li>maxLength 属性の動作が変更されました。IN および INOUT パラメータ値に適用されるようになりました。</li>
</ul>

<p>

</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">使用方法</span>
<p>
ストアードプロシージャのパラメータとそれらのデータタイプを識別するときにこのタグを使用します。パラメータごとに 1 つの cfprocparam タグをコーディングしてください。パラメータ タイプと DBMS によって、コーディングするパラメータは異なります。ColdFusion MX では、位置パラメータのみがサポートされます。cfprocparam タグは、ストアードプロシージャ定義の関連パラメータと同じ順序でコーディングする必要があります。
</p>

<p>
出力変数は、variable 属性で指定された ColdFusion 変数に格納されます。
</p>

<p>
cfprocparam タグは、Oracle 8 および 9 の Reference Cursor には使用できません。代わりに、cfprocresult タグを使用します。
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">例</span>
<p>
次の例では、Oracle 8 PL/SQL ストアードプロシージャを呼び出す方法を示します。ここでは、Reference Cursor タイプの Oracle 8 のサポートを利用しています。
</p>

<p>
次のパッケージ Foo_Data には、出力パラメータを Reference Cursor として宣言するプロシージャ refcurproc が含まれています。
</p>
<ul>

<li>パラメータ pParam1 は、EMP テーブルに行を返します。</li>

<li>パラメータ pParam2 は、DEPT テーブルに行を返します。 </li>
</ul>

<p>
このプロシージャでは、1 つの入力パラメータを整数として、1 つの出力パラメータを 2 バイトの char varying タイプとして宣言します。cfstoredproc タグによってこのプロシージャを呼び出せるようにするには、RDBMS 環境でこのプロシージャを作成、コンパイル、およびバインドしておく必要があります。
</p>
<pre>CREATE OR REPLACE PACKAGE Foo_Data AS
    TYPE EmpTyp IS REF CURSOR RETURN Emp%ROWTYPE;
    TYPE DeptTyp IS REF CURSOR RETURN Dept%ROWTYPE;
 refcurproc(pParam1 in out EmpTyp, pParam2 in out DeptTyp,
pParam3 in integer, pParam4 out varchar2);
END foo_data;

CREATE OR REPLACE PACKAGE BODY Foo_Data AS
   PROCEDURE RefCurProc(pParam1 in out EmpTyp,
         pParam2 in out DeptTyp,
         pParam3 in integer,
         pParam4 out varchar2) IS
   BEGIN
      OPEN pParam1 FOR select * from emp;
      OPEN pParam2 FOR select * from dept;
      IF pParam3 = 1
      THEN
         pParam4:= &#39;hello&#39;;
      ELSE
         pParam4:= &#39;goodbye&#39;;
      END IF;
   END RefCurProc;
END Foo_Data;
</pre>
<p>
次の CFML の例では、cfstoredproc、cfprocparam、および cfprocresult を使用して、RefCurProc プロシージャを呼び出す方法を示しています。
</p>
<pre>&lt;cfstoredproc&#160;&#160; procedure = &quot;foo_data.refcurproc&quot;
   dataSource = &quot;oracle8i&quot;
   username = &quot;scott&quot;
   password = &quot;tiger&quot;
   returnCode = &quot;No&quot;&gt;

   &lt;cfprocparam type = &quot;Out&quot; CFSQLType = &quot;CF_SQL_REFCURSOR&quot;
      variable = &quot;param1&quot;&gt;
   &lt;cfprocparam type = &quot;Out&quot; CFSQLType = &quot;CF_SQL_REFCURSOR&quot;
      variable = &quot;param2&quot;&gt;
   &lt;cfprocparam type = &quot;IN&quot; CFSQLType = &quot;CF_SQL_INTEGER&quot; value = &quot;1&quot;&gt;

   &lt;cfprocparam type = &quot;OUT&quot; CFSQLType = &quot;CF_SQL_VARCHAR&quot;
      variable = &quot;FOO&quot;&gt;
   &lt;cfprocresult name = &quot;rs1&quot;&gt;
   &lt;cfprocresult name = &quot;rs2&quot; resultSet = &quot;2&quot;&gt;
&lt;/cfstoredproc&gt;

&lt;b&gt;最初の結果セット :&lt;/b&gt;&lt;br&gt;
&lt;hr&gt;
&lt;cftable query = &quot;rs1&quot; colHeaders HTMLTable border = &quot;1&quot;&gt;
   &lt;cfcol header = &quot;EMPNO&quot; text = &quot;#EMPNO#&quot;&gt;
   &lt;cfcol header = &quot;EMPLOYEE name&quot; text = &quot;#ENAME#&quot;&gt;
   &lt;cfcol header = &quot;JOB&quot; text = &quot;#JOB#&quot;&gt;
   &lt;cfcol header = &quot;SALARY&quot; text = &quot;#SAL#&quot;&gt;
   &lt;cfcol header = &quot;DEPT NUMBER&quot; text = &quot;#DEPTNO#&quot;&gt;
&lt;/cftable&gt;

&lt;hr&gt;
&lt;b&gt;2 番めの結果セット:&lt;/b&gt;&lt;br&gt;

&lt;cftable query = &quot;rs2&quot; colHeaders HTMLTable border = &quot;1&quot;&gt;
   &lt;cfcol header = &quot;DEPT name&quot; text = &quot;#DNAME#&quot;&gt;
   &lt;cfcol header = &quot;DEPT NUMBER&quot; text = &quot;#DEPTNO#&quot;&gt;
&lt;/cftable&gt;
&lt;hr&gt;
&lt;cfoutput&gt;
   &lt;b&gt;出力パラメータ :&lt;/b&gt;&#39;#FOO#&#39;
&lt;/cfoutput&gt;
</pre>
         </td>
      </tr>
   </table>
   </div>
<div id="TYPE">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">TYPE</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">オプション</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">

<strong>Default value:</strong> "in"

<ul>

<li>in: データベースシステムにデータを送信するときにのみ使用します。値でパラメータを渡します。 </li>

<li>out: データベースシステムからデータを受信するときにのみ使用します。パラメータをバインド変数として渡します。</li>

<li>inout: データを送信および受信するときに使用します。パラメータをバインド変数として渡します。</li>
</ul>


  </td>
  </tr>
  </table>
</div>
<div id="VARIABLE">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">VARIABLE</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">type = &quot;OUT&quot; または &quot;INOUT&quot; の場合は必須</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">



<p>ColdFusion 変数名です。ストアードプロシージャが呼び出された後、出力パラメータに与えられる値を参照します。IN パラメータの場合は無視されます。</p>

  </td>
  </tr>
  </table>
</div>
<div id="VALUE">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">VALUE</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">type = &quot;IN&quot; の場合は必須</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">



<p>ColdFusion からストアードプロシージャに渡される値です。INOUT パラメータの場合はオプションです。</p>

  </td>
  </tr>
  </table>
</div>
<div id="CFSQLTYPE">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">CFSQLTYPE</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">必須</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">



<p>任意のタイプのパラメータをバインドする SQL タイプです。ColdFusion では以下の値がサポートされます。名前の末尾の要素は SQL データタイプに対応しています。データベースシステムによっては、このリストの別のサブセットがサポートされる場合があります。サポートされているパラメータタイプについては、ご使用の DBMS のドキュメントを参照してください。</p><ul>

<li>CF_SQL_BIGINT</li>

<li>CF_SQL_BIT</li>

<li>CF_SQL_BLOB</li>

<li>CF_SQL_CHAR</li>

<li>CF_SQL_CLOB</li>

<li>CF_SQL_DATE</li>

<li>CF_SQL_DECIMAL</li>

<li>CF_SQL_DOUBLE</li>

<li>CF_SQL_FLOAT</li>

<li>CF_SQL_IDSTAMP</li>

<li>CF_SQL_INTEGER</li>

<li>CF_SQL_LONGVARCHAR</li>

<li>CF_SQL_MONEY</li>

<li>CF_SQL_MONEY4</li>

<li>CF_SQL_NUMERIC</li>

<li>CF_SQL_REAL</li>

<li>CF_SQL_REFCURSOR</li>

<li>CF_SQL_SMALLINT</li>

<li>CF_SQL_TIME</li>

<li>CF_SQL_TIMESTAMP</li>

<li>CF_SQL_TINYINT</li>

<li>CF_SQL_VARCHAR</li>
</ul>

<p>ColdFusion SQL データタイプから JDBC データタイプへのマッピングについては、cfqueryparamも参照してください。</p>

  </td>
  </tr>
  </table>
</div>
<div id="MAXLENGTH">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">MAXLENGTH</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">オプション</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">

<strong>Default value:</strong> "0"


<p>IN または INOUT の場合での、value 属性の文字列の最大長です。maxLength を 0 に指定すると、長さは任意になります。type=out を指定するときは、maxLength 属性は不要です。</p>

  </td>
  </tr>
  </table>
</div>
<div id="SCALE">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">SCALE</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">オプション</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">

<strong>Default value:</strong> "0"


<p>数値パラメータの小数点以下の桁数です。scale が 0 の場合、値は整数に制限されます。 </p>

  </td>
  </tr>
  </table>
</div>
<div id="NULL">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">NULL</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">オプション</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">

<strong>Default value:</strong> "No"


<p>パラメータを null 値として渡すかどうかを指定します。OUT タイプのパラメータでは使用しません。</p><ul>

<li>Yes: value 属性を無視します。</li>

<li>No</li>
</ul>


  </td>
  </tr>
  </table>
</div>

  </body>
</html>
