<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.uodbc.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'uk',
  ),
  'this' => 
  array (
    0 => 'function.odbc-tables.php',
    1 => 'odbc_tables',
    2 => 'Get the list of table names stored in a specific data source',
  ),
  'up' => 
  array (
    0 => 'ref.uodbc.php',
    1 => 'ODBC Функції',
  ),
  'prev' => 
  array (
    0 => 'function.odbc-tableprivileges.php',
    1 => 'odbc_tableprivileges',
  ),
  'next' => 
  array (
    0 => 'book.pdo.php',
    1 => 'PDO',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/uodbc/functions/odbc-tables.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.odbc-tables" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">odbc_tables</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">odbc_tables</span> &mdash; <span class="dc-title">Get the list of table names stored in a specific data source</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.odbc-tables-description">
  <h3 class="title">Опис</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>odbc_tables</strong></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">Odbc\Connection</span> <code class="parameter">$odbc</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.string.php" class="type string">string</a></span></span> <code class="parameter">$catalog</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.string.php" class="type string">string</a></span></span> <code class="parameter">$schema</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.string.php" class="type string">string</a></span></span> <code class="parameter">$table</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.string.php" class="type string">string</a></span></span> <code class="parameter">$types</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span><br>): <span class="type"><span class="type">Odbc\Result</span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   Lists all tables in the requested range.
  </p>
  <p class="para">
   To support enumeration of qualifiers, owners, and table types,
   the following special semantics for the
   <code class="parameter">catalog</code>, <code class="parameter">schema</code>,
   <code class="parameter">table</code>, and
   <code class="parameter">table_type</code> are available:
   <ul class="itemizedlist">
    <li class="listitem">
     <span class="simpara">
      If <code class="parameter">catalog</code> is a single percent
      character (%) and <code class="parameter">schema</code> and
      <code class="parameter">table</code> are empty strings, then the result
      set contains a list of valid qualifiers for the data
      source. (All columns except the TABLE_QUALIFIER column contain
      NULLs.)
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      If <code class="parameter">schema</code> is a single percent character
      (%) and <code class="parameter">catalog</code> and
      <code class="parameter">table</code> are empty strings, then the result
      set contains a list of valid owners for the data source. (All
      columns except the TABLE_OWNER column contain
      NULLs.)
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      If <code class="parameter">table_type</code> is a single percent
      character (%) and <code class="parameter">catalog</code>,
      <code class="parameter">schema</code> and <code class="parameter">table</code>
      are empty strings, then the result set contains a list of
      valid table types for the data source. (All columns except the
      TABLE_TYPE column contain NULLs.)
     </span>
    </li>
   </ul>
  </p>
 </div>

 
 <div class="refsect1 parameters" id="refsect1-function.odbc-tables-parameters">
  <h3 class="title">Параметри</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">odbc</code></dt>
     <dd>
      <p class="para">Ідентифікатор з&#039;єднання ODBC.
Докладніше: <span class="function"><a href="function.odbc-connect.php" class="function">odbc_connect()</a></span>.</p>
     </dd>
    
    
     <dt><code class="parameter">catalog</code></dt>
     <dd>
      <p class="para">
       Каталог (&#039;qualifier&#039; мовою ODBC 2).
      </p>
     </dd>
    
    
     <dt><code class="parameter">schema</code></dt>
     <dd>
      <p class="para">
       Схема (&#039;owner&#039; мовою ODBC 2).
       Цей параметр може містити наступні шаблони пошуку: <code class="literal">%</code> — щоб вибирати нуль або
більше символів, та <code class="literal">_</code> —
щоб вибрати один символ.
      </p>
     </dd>
    
    
     <dt><code class="parameter">table</code></dt>
     <dd>
      <p class="para">
       The name.
       Цей параметр може містити наступні шаблони пошуку: <code class="literal">%</code> — щоб вибирати нуль або
більше символів, та <code class="literal">_</code> —
щоб вибрати один символ.
      </p>
     </dd>
    
    
     <dt><code class="parameter">types</code></dt>
     <dd>
      <p class="para">
       If <code class="parameter">table_type</code> is not an empty string, it
       must contain a list of comma-separated values for the types of
       interest; each value may be enclosed in single quotes (<code class="literal">&#039;</code>) or
       unquoted. For example, <code class="literal">&#039;TABLE&#039;,&#039;VIEW&#039;</code> or <code class="literal">TABLE, VIEW</code>.  If the
       data source does not support a specified table type,
       <span class="function"><strong>odbc_tables()</strong></span> does not return any results for
       that type.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.odbc-tables-returnvalues">
  <h3 class="title">Значення, що повертаються</h3>
  <p class="para">
   Returns an ODBC result object containing the information
    або <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> в разі помилки.
  </p>
  <p class="para">
   The result set has the following columns:
   <ul class="itemizedlist">
    <li class="listitem"><span class="simpara"><code class="literal">TABLE_CAT</code></span></li>
    <li class="listitem"><span class="simpara"><code class="literal">TABLE_SCHEM</code></span></li>
    <li class="listitem"><span class="simpara"><code class="literal">TABLE_NAME</code></span></li>
    <li class="listitem"><span class="simpara"><code class="literal">TABLE_TYPE</code></span></li>
    <li class="listitem"><span class="simpara"><code class="literal">REMARKS</code></span></li>
   </ul>
   Драйвер може оголошувати додаткові стовпці.
  </p>
  <p class="simpara">
   The result set is ordered by <code class="literal">TABLE_TYPE</code>, <code class="literal">TABLE_CAT</code>,
   <code class="literal">TABLE_SCHEM</code> and <code class="literal">TABLE_NAME</code>.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.odbc-tables-changelog">
  <h3 class="title">Журнал змін</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Версія</th>
      <th>Опис</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
 <td>8.4.0</td>
 <td>
  <code class="parameter">odbc</code> expects an <span class="classname"><strong class="classname">Odbc\Connection</strong></span>
  instance now; previously, a <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> was expected.
 </td>
</tr>

     <tr>
 <td>8.4.0</td>
 <td>
  This function returns an <span class="classname"><strong class="classname">Odbc\Result</strong></span>
  instance now; previously, a <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> was returned.
 </td>
</tr>

     <tr>
      <td>8.0.0</td>
      <td>
       <code class="parameter">schema</code>, <code class="parameter">table</code> and <code class="parameter">types</code>
       are now nullable.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-function.odbc-tables-examples">
  <h3 class="title">Приклади</h3>
  <div class="example" id="odbc-tables.example.basic">
   <p><strong>Приклад #1 List Tables in a Catalog</strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$conn </span><span style="color: #007700">= </span><span style="color: #0000BB">odbc_connect</span><span style="color: #007700">(</span><span style="color: #0000BB">$dsn</span><span style="color: #007700">, </span><span style="color: #0000BB">$user</span><span style="color: #007700">, </span><span style="color: #0000BB">$pass</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$tables </span><span style="color: #007700">= </span><span style="color: #0000BB">odbc_tables</span><span style="color: #007700">(</span><span style="color: #0000BB">$conn</span><span style="color: #007700">, </span><span style="color: #DD0000">'SalesOrders'</span><span style="color: #007700">, </span><span style="color: #DD0000">'dbo'</span><span style="color: #007700">, </span><span style="color: #DD0000">'%'</span><span style="color: #007700">, </span><span style="color: #DD0000">'TABLE'</span><span style="color: #007700">);<br />while ((</span><span style="color: #0000BB">$row </span><span style="color: #007700">= </span><span style="color: #0000BB">odbc_fetch_array</span><span style="color: #007700">(</span><span style="color: #0000BB">$tables</span><span style="color: #007700">))) {<br />    </span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">$row</span><span style="color: #007700">);<br />    break; </span><span style="color: #FF8000">// further rows omitted for brevity<br /></span><span style="color: #007700">}<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

   <div class="example-contents"><p>Поданий вище приклад виведе щось
схоже на:</p></div>
   <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">Array
(
    [TABLE_CAT] =&gt; SalesOrders
    [TABLE_SCHEM] =&gt; dbo
    [TABLE_NAME] =&gt; Orders
    [TABLE_TYPE] =&gt; TABLE
    [REMARKS] =&gt;
)</pre>
</div>
   </div>
  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.odbc-tables-seealso">
  <h3 class="title">Прогляньте також</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.odbc-tableprivileges.php" class="function" rel="rdfs-seeAlso">odbc_tableprivileges()</a> - Lists tables and the privileges associated with each table</span></li>
    <li><span class="function"><a href="function.odbc-columns.php" class="function" rel="rdfs-seeAlso">odbc_columns()</a> - Lists the column names in specified tables</span></li>
    <li><span class="function"><a href="function.odbc-specialcolumns.php" class="function" rel="rdfs-seeAlso">odbc_specialcolumns()</a> - Retrieves special columns</span></li>
    <li><span class="function"><a href="function.odbc-statistics.php" class="function" rel="rdfs-seeAlso">odbc_statistics()</a> - Retrieve statistics about a table</span></li>
    <li><span class="function"><a href="function.odbc-procedures.php" class="function" rel="rdfs-seeAlso">odbc_procedures()</a> - Get the list of procedures stored in a specific data source</span></li>
   </ul>
  </p>
 </div>


</div><?php manual_footer($setup); ?>