<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Returns a result set listing the unique row identifier columns for a table</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.db2-set-option.html">db2_set_option</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.db2-statistics.html">db2_statistics</a></div> <div class="up"><a href="ref.ibm-db2.html">IBM DB2 Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="function.db2-special-columns" class="refentry"> <div class="refnamediv"> <h1 class="refname">db2_special_columns</h1> <p class="verinfo">(PECL ibm_db2 >= 1.0.0)</p><p class="refpurpose"><span class="refname">db2_special_columns</span> — <span class="dc-title"> Returns a result set listing the unique row identifier columns for a table </span></p> </div> <div class="refsect1 description" id="refsect1-function.db2-special-columns-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">resource</span> <span class="methodname"><strong>db2_special_columns</strong></span> ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$connection</code></span> , <span class="methodparam"><span class="type">string</span> <code class="parameter">$qualifier</code></span> , <span class="methodparam"><span class="type">string</span> <code class="parameter">$schema</code></span> , <span class="methodparam"><span class="type">string</span> <code class="parameter">$table_name</code></span> , <span class="methodparam"><span class="type">int</span> <code class="parameter">$scope</code></span> )</div> <p class="para rdfs-comment"> Returns a result set listing the unique row identifier columns for a table. </p> </div> <div class="refsect1 parameters" id="refsect1-function.db2-special-columns-parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><em><code class="parameter">connection</code></em></span> <dd> <p class="para"> A valid connection to an IBM DB2, Cloudscape, or Apache Derby database. </p> </dd> </dt> <dt> <span class="term"><em><code class="parameter">qualifier</code></em></span> <dd> <p class="para"> A qualifier for DB2 databases running on OS/390 or z/OS servers. For other databases, pass <strong><code>NULL</code></strong> or an empty string. </p> </dd> </dt> <dt> <span class="term"><em><code class="parameter">schema</code></em></span> <dd> <p class="para"> The schema which contains the tables. </p> </dd> </dt> <dt> <span class="term"><em><code class="parameter">table_name</code></em></span> <dd> <p class="para"> The name of the table. </p> </dd> </dt> <dt> <span class="term"><em><code class="parameter">scope</code></em></span> <dd> <p class="para"> Integer value representing the minimum duration for which the unique row identifier is valid. This can be one of the following values: <table class="doctable informaltable"> <thead> <tr> <th>Integer value</th> <th>SQL constant</th> <th>Description</th> </tr> </thead> <tbody class="tbody"> <tr> <td>0</td> <td>SQL_SCOPE_CURROW</td> <td>Row identifier is valid only while the cursor is positioned on the row.</td> </tr> <tr> <td>1</td> <td>SQL_SCOPE_TRANSACTION</td> <td>Row identifier is valid for the duration of the transaction.</td> </tr> <tr> <td>2</td> <td>SQL_SCOPE_SESSION</td> <td>Row identifier is valid for the duration of the connection.</td> </tr> </tbody> </table> </p> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues" id="refsect1-function.db2-special-columns-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns a statement resource with a result set containing rows with unique row identifier information for a table. The rows are composed of the following columns: <table class="doctable informaltable"> <thead> <tr> <th>Column name</th> <th>Description</th> </tr> </thead> <tbody class="tbody"> <tr> <td>SCOPE</td> <td> <p class="para"> <table class="doctable informaltable"> <thead> <tr> <th>Integer value</th> <th>SQL constant</th> <th>Description</th> </tr> </thead> <tbody class="tbody"> <tr> <td>0</td> <td>SQL_SCOPE_CURROW</td> <td>Row identifier is valid only while the cursor is positioned on the row.</td> </tr> <tr> <td>1</td> <td>SQL_SCOPE_TRANSACTION</td> <td>Row identifier is valid for the duration of the transaction.</td> </tr> <tr> <td>2</td> <td>SQL_SCOPE_SESSION</td> <td>Row identifier is valid for the duration of the connection.</td> </tr> </tbody> </table> </p> </td> </tr> <tr> <td>COLUMN_NAME</td> <td>Name of the unique column.</td> </tr> <tr> <td>DATA_TYPE</td> <td>SQL data type for the column.</td> </tr> <tr> <td>TYPE_NAME</td> <td>Character string representation of the SQL data type for the column.</td> </tr> <tr> <td>COLUMN_SIZE</td> <td>An integer value representing the size of the column.</td> </tr> <tr> <td>BUFFER_LENGTH</td> <td> Maximum number of bytes necessary to store data from this column. </td> </tr> <tr> <td>DECIMAL_DIGITS</td> <td> The scale of the column, or <strong><code>NULL</code></strong> where scale is not applicable. </td> </tr> <tr> <td>NUM_PREC_RADIX</td> <td> An integer value of either <em>10</em> (representing an exact numeric data type), <em>2</em> (representing an approximate numeric data type), or <strong><code>NULL</code></strong> (representing a data type for which radix is not applicable). </td> </tr> <tr> <td>PSEUDO_COLUMN</td> <td>Always returns 1.</td> </tr> </tbody> </table> </p> </div> <div class="refsect1 seealso" id="refsect1-function.db2-special-columns-seealso"> <h3 class="title">See Also</h3> <p class="para"> <ul class="simplelist"> <li class="member"> <span class="function"><a href="function.db2-column-privileges.html" class="function" rel="rdfs-seeAlso">db2_column_privileges()</a> - Returns a result set listing the columns and associated privileges for a table</span></li> <li class="member"> <span class="function"><a href="function.db2-columns.html" class="function" rel="rdfs-seeAlso">db2_columns()</a> - Returns a result set listing the columns and associated metadata for a table</span></li> <li class="member"> <span class="function"><a href="function.db2-foreign-keys.html" class="function" rel="rdfs-seeAlso">db2_foreign_keys()</a> - Returns a result set listing the foreign keys for a table</span></li> <li class="member"> <span class="function"><a href="function.db2-primary-keys.html" class="function" rel="rdfs-seeAlso">db2_primary_keys()</a> - Returns a result set listing primary keys for a table</span></li> <li class="member"> <span class="function"><a href="function.db2-procedure-columns.html" class="function" rel="rdfs-seeAlso">db2_procedure_columns()</a> - Returns a result set listing stored procedure parameters</span></li> <li class="member"> <span class="function"><a href="function.db2-procedures.html" class="function" rel="rdfs-seeAlso">db2_procedures()</a> - Returns a result set listing the stored procedures registered in a database</span></li> <li class="member"> <span class="function"><a href="function.db2-statistics.html" class="function" rel="rdfs-seeAlso">db2_statistics()</a> - Returns a result set listing the index and statistics for a table</span></li> <li class="member"> <span class="function"><a href="function.db2-table-privileges.html" class="function" rel="rdfs-seeAlso">db2_table_privileges()</a> - Returns a result set listing the tables and associated privileges in a database</span></li> <li class="member"> <span class="function"><a href="function.db2-tables.html" class="function" rel="rdfs-seeAlso">db2_tables()</a> - Returns a result set listing the tables and associated metadata in a database</span></li> </ul> </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.db2-set-option.html">db2_set_option</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.db2-statistics.html">db2_statistics</a></div> <div class="up"><a href="ref.ibm-db2.html">IBM DB2 Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>