reference/uodbc/functions/odbc-tables.xml
902c2b77f827e8d0ecccf4f62fb90065d2f6ef79
...
...
@@ -9,12 +9,12 @@
9
9
<refsect1 role="description">
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
-
<type>resource</type><methodname>odbc_tables</methodname>
13
-
<methodparam><type>resource</type><parameter>connection_id</parameter></methodparam>
14
-
<methodparam choice="opt"><type>string</type><parameter>qualifier</parameter></methodparam>
15
-
<methodparam choice="opt"><type>string</type><parameter>owner</parameter></methodparam>
16
-
<methodparam choice="opt"><type>string</type><parameter>name</parameter></methodparam>
17
-
<methodparam choice="opt"><type>string</type><parameter>types</parameter></methodparam>
12
+
<type class="union"><type>resource</type><type>false</type></type><methodname>odbc_tables</methodname>
13
+
<methodparam><type>resource</type><parameter>odbc</parameter></methodparam>
14
+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>catalog</parameter><initializer>&null;</initializer></methodparam>
15
+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>schema</parameter><initializer>&null;</initializer></methodparam>
16
+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>table</parameter><initializer>&null;</initializer></methodparam>
17
+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>types</parameter><initializer>&null;</initializer></methodparam>
18
18
</methodsynopsis>
19
19
<para>
20
20
Lists all tables in the requested range.
...
...
@@ -22,15 +22,15 @@
22
22
<para>
23
23
To support enumeration of qualifiers, owners, and table types,
24
24
the following special semantics for the
25
-
<parameter>qualifier</parameter>, <parameter>owner</parameter>,
26
-
<parameter>name</parameter>, and
25
+
<parameter>catalog</parameter>, <parameter>schema</parameter>,
26
+
<parameter>table</parameter>, and
27
27
<parameter>table_type</parameter> are available:
28
28
<itemizedlist>
29
29
<listitem>
30
30
<simpara>
31
-
If <parameter>qualifier</parameter> is a single percent
32
-
character (%) and <parameter>owner</parameter> and
33
-
<parameter>name</parameter> are empty strings, then the result
31
+
If <parameter>catalog</parameter> is a single percent
32
+
character (%) and <parameter>schema</parameter> and
33
+
<parameter>table</parameter> are empty strings, then the result
34
34
set contains a list of valid qualifiers for the data
35
35
source. (All columns except the TABLE_QUALIFIER column contain
36
36
NULLs.)
...
...
@@ -38,9 +38,9 @@
38
38
</listitem>
39
39
<listitem>
40
40
<simpara>
41
-
If <parameter>owner</parameter> is a single percent character
42
-
(%) and <parameter>qualifier</parameter> and
43
-
<parameter>name</parameter> are empty strings, then the result
41
+
If <parameter>schema</parameter> is a single percent character
42
+
(%) and <parameter>catalog</parameter> and
43
+
<parameter>table</parameter> are empty strings, then the result
44
44
set contains a list of valid owners for the data source. (All
45
45
columns except the TABLE_OWNER column contain
46
46
NULLs.)
...
...
@@ -49,8 +49,8 @@
49
49
<listitem>
50
50
<simpara>
51
51
If <parameter>table_type</parameter> is a single percent
52
-
character (%) and <parameter>qualifier</parameter>,
53
-
<parameter>owner</parameter> and <parameter>name</parameter>
52
+
character (%) and <parameter>catalog</parameter>,
53
+
<parameter>schema</parameter> and <parameter>table</parameter>
54
54
are empty strings, then the result set contains a list of
55
55
valid table types for the data source. (All columns except the
56
56
TABLE_TYPE column contain NULLs.)
...
...
@@ -65,34 +65,34 @@
65
65
<para>
66
66
<variablelist>
67
67
<varlistentry>
68
-
<term><parameter>connection_id</parameter></term>
68
+
<term><parameter>odbc</parameter></term>
69
69
<listitem>
70
70
&odbc.connection.id;
71
71
</listitem>
72
72
</varlistentry>
73
73
<varlistentry>
74
-
<term><parameter>qualifier</parameter></term>
74
+
<term><parameter>catalog</parameter></term>
75
75
<listitem>
76
76
<para>
77
-
The qualifier.
77
+
&odbc.parameter.catalog;
78
78
</para>
79
79
</listitem>
80
80
</varlistentry>
81
81
<varlistentry>
82
-
<term><parameter>owner</parameter></term>
82
+
<term><parameter>schema</parameter></term>
83
83
<listitem>
84
84
<para>
85
-
The owner. Accepts search patterns ('%' to match zero or more
86
-
characters and '_' to match a single character).
85
+
&odbc.parameter.schema;
86
+
&odbc.parameter.search;
87
87
</para>
88
88
</listitem>
89
89
</varlistentry>
90
90
<varlistentry>
91
-
<term><parameter>name</parameter></term>
91
+
<term><parameter>table</parameter></term>
92
92
<listitem>
93
93
<para>
94
-
The name. Accepts search patterns ('%' to match zero or more
95
-
characters and '_' to match a single character).
94
+
The name.
95
+
&odbc.parameter.search;
96
96
</para>
97
97
</listitem>
98
98
</varlistentry>
...
...
@@ -102,8 +102,8 @@
102
102
<para>
103
103
If <parameter>table_type</parameter> is not an empty string, it
104
104
must contain a list of comma-separated values for the types of
105
-
interest; each value may be enclosed in single quotes (') or
106
-
unquoted. For example, "'TABLE','VIEW'" or "TABLE, VIEW". If the
105
+
interest; each value may be enclosed in single quotes (<literal>'</literal>) or
106
+
unquoted. For example, <literal>'TABLE','VIEW'</literal> or <literal>TABLE, VIEW</literal>. If the
107
107
data source does not support a specified table type,
108
108
<function>odbc_tables</function> does not return any results for
109
109
that type.
...
...
@@ -118,35 +118,94 @@
118
118
&reftitle.returnvalues;
119
119
<para>
120
120
Returns an ODBC result identifier containing the information
121
-
&return.falseforfailure;.
121
+
&return.falseforfailure;.
122
122
</para>
123
123
<para>
124
124
The result set has the following columns:
125
125
<itemizedlist>
126
-
<listitem><simpara>TABLE_QUALIFIER</simpara></listitem>
127
-
<listitem><simpara>TABLE_OWNER</simpara></listitem>
128
-
<listitem><simpara>TABLE_NAME</simpara></listitem>
129
-
<listitem><simpara>TABLE_TYPE</simpara></listitem>
130
-
<listitem><simpara>REMARKS</simpara></listitem>
126
+
<listitem><simpara><literal>TABLE_CAT</literal></simpara></listitem>
127
+
<listitem><simpara><literal>TABLE_SCHEM</literal></simpara></listitem>
128
+
<listitem><simpara><literal>TABLE_NAME</literal></simpara></listitem>
129
+
<listitem><simpara><literal>TABLE_TYPE</literal></simpara></listitem>
130
+
<listitem><simpara><literal>REMARKS</literal></simpara></listitem>
131
131
</itemizedlist>
132
+
&odbc.result.driver-specific;
132
133
</para>
133
134
<simpara>
134
-
The result set is ordered by TABLE_TYPE, TABLE_QUALIFIER,
135
-
TABLE_OWNER and TABLE_NAME.
135
+
The result set is ordered by <literal>TABLE_TYPE</literal>, <literal>TABLE_CAT</literal>,
136
+
<literal>TABLE_SCHEM</literal> and <literal>TABLE_NAME</literal>.
136
137
</simpara>
137
138
</refsect1>
138
139

140
+
<refsect1 role="changelog">
141
+
&reftitle.changelog;
142
+
<informaltable>
143
+
<tgroup cols="2">
144
+
<thead>
145
+
<row>
146
+
<entry>&Version;</entry>
147
+
<entry>&Description;</entry>
148
+
</row>
149
+
</thead>
150
+
<tbody>
151
+
<row>
152
+
<entry>8.0.0</entry>
153
+
<entry>
154
+
<parameter>schema</parameter>, <parameter>table</parameter> and <parameter>types</parameter>
155
+
are now nullable.
156
+
</entry>
157
+
</row>
158
+
</tbody>
159
+
</tgroup>
160
+
</informaltable>
161
+
</refsect1>
162
+

163
+
<refsect1 role="examples">
164
+
&reftitle.examples;
165
+
<example xml:id="odbc-tables.example.basic">
166
+
<title>List Tables in a Catalog</title>
167
+
<programlisting role="php">
168
+
<![CDATA[
169
+
<?php
170
+
$conn = odbc_connect($dsn, $user, $pass);
171
+
$tables = odbc_tables($conn, 'SalesOrders', 'dbo', '%', 'TABLE');
172
+
while (($row = odbc_fetch_array($tables))) {
173
+
print_r($row);
174
+
break; // further rows omitted for brevity
175
+
}
176
+
?>
177
+
]]>
178
+
</programlisting>
179
+
&example.outputs.similar;
180
+
<screen>
181
+
<![CDATA[
182
+
Array
183
+
(
184
+
[TABLE_CAT] => SalesOrders
185
+
[TABLE_SCHEM] => dbo
186
+
[TABLE_NAME] => Orders
187
+
[TABLE_TYPE] => TABLE
188
+
[REMARKS] =>
189
+
)
190
+
]]>
191
+
</screen>
192
+
</example>
193
+
</refsect1>
194
+

139
195
<refsect1 role="seealso">
140
196
&reftitle.seealso;
141
197
<para>
142
198
<simplelist>
143
199
<member><function>odbc_tableprivileges</function></member>
200
+
<member><function>odbc_columns</function></member>
201
+
<member><function>odbc_specialcolumns</function></member>
202
+
<member><function>odbc_statistics</function></member>
203
+
<member><function>odbc_procedures</function></member>
144
204
</simplelist>
145
205
</para>
146
206
</refsect1>
147
207

148
208
</refentry>
149
-

150
209
<!-- Keep this comment at the end of the file
151
210
Local variables:
152
211
mode: sgml
153
212