reference/uodbc/functions/odbc-binmode.xml
db22a7cfcbc3af221f67e228336ac3e2d62aaf2c
...
...
@@ -8,23 +8,30 @@
8
8
<refsect1 role="description">
9
9
&reftitle.description;
10
10
<methodsynopsis>
11
-
<type>bool</type><methodname>odbc_binmode</methodname>
12
-
<methodparam><type>resource</type><parameter>result_id</parameter></methodparam>
11
+
<type>true</type><methodname>odbc_binmode</methodname>
12
+
<methodparam><type>resource</type><parameter>statement</parameter></methodparam>
13
13
<methodparam><type>int</type><parameter>mode</parameter></methodparam>
14
14
</methodsynopsis>
15
15
<para>
16
-
Enables handling of binary column data. ODBC SQL types affected are
16
+
Controls handling of binary column data. ODBC SQL types affected are
17
17
<literal>BINARY</literal>, <literal>VARBINARY</literal>, and
18
18
<literal>LONGVARBINARY</literal>.
19
+
The default mode can be set using the
20
+
<link linkend="ini.uodbc.defaultbinmode">uodbc.defaultbinmode</link> &php.ini; directive.
19
21
</para>
20
22
<para>
21
-
When binary SQL data is converted to character C data, each byte
23
+
When binary SQL data is converted to character C data (<constant>ODBC_BINMODE_CONVERT</constant>), each byte
22
24
(8 bits) of source data is represented as two ASCII characters.
23
25
These characters are the ASCII character representation of the
24
26
number in its hexadecimal form. For example, a binary
25
27
<literal>00000001</literal> is converted to
26
28
<literal>"01"</literal> and a binary <literal>11111111</literal>
27
29
is converted to <literal>"FF"</literal>.
30
+
</para>
31
+
<para>
32
+
While the handling of <literal>BINARY</literal> and <literal>VARBINARY</literal>
33
+
columns only depend on the binmode, the handling of <literal>LONGVARBINARY</literal>
34
+
columns also depends on the longreadlen as well:
28
35
<table>
29
36
<title>LONGVARBINARY handling</title>
30
37
<tgroup cols="3">
...
...
@@ -53,22 +60,17 @@
53
60
</row>
54
61
<row>
55
62
<entry><constant>ODBC_BINMODE_PASSTHRU</constant></entry>
56
-
<entry>0</entry>
57
-
<entry>passthru</entry>
58
-
</row>
59
-
<row>
60
-
<entry><constant>ODBC_BINMODE_PASSTHRU</constant></entry>
61
-
<entry>>0</entry>
63
+
<entry>&gt;0</entry>
62
64
<entry>passthru</entry>
63
65
</row>
64
66
<row>
65
67
<entry><constant>ODBC_BINMODE_RETURN</constant></entry>
66
-
<entry>>0</entry>
68
+
<entry>&gt;0</entry>
67
69
<entry>return as is</entry>
68
70
</row>
69
71
<row>
70
72
<entry><constant>ODBC_BINMODE_CONVERT</constant></entry>
71
-
<entry>>0</entry>
73
+
<entry>&gt;0</entry>
72
74
<entry>return as char</entry>
73
75
</row>
74
76
</tbody>
...
...
@@ -78,6 +80,8 @@
78
80
<para>
79
81
If <function>odbc_fetch_into</function> is used, passthru means that an
80
82
empty string is returned for these columns.
83
+
If <function>odbc_result</function> is used, passthru means that the data are
84
+
sent directly to the client (i.e. printed).
81
85
</para>
82
86
</refsect1>
83
87
<refsect1 role="parameters">
...
...
@@ -85,22 +89,14 @@
85
89
<para>
86
90
<variablelist>
87
91
<varlistentry>
88
-
<term><parameter>result_id</parameter></term>
92
+
<term><parameter>statement</parameter></term>
89
93
<listitem>
90
94
<para>
91
95
The result identifier.
92
96
</para>
93
97
<para>
94
-
If <parameter>result_id</parameter> is <literal>0</literal>, the
98
+
If <parameter>statement</parameter> is <literal>0</literal>, the
95
99
settings apply as default for new results.
96
-
<note>
97
-
<simpara>
98
-
Default for <literal>longreadlen</literal> is <literal>4096</literal> and
99
-
<parameter>mode</parameter> defaults to
100
-
<literal>ODBC_BINMODE_RETURN</literal>. Handling of binary long
101
-
columns is also affected by <function>odbc_longreadlen</function>.
102
-
</simpara>
103
-
</note>
104
100
</para>
105
101
</listitem>
106
102
</varlistentry>
...
...
@@ -126,6 +122,12 @@
126
122
</simpara>
127
123
</listitem>
128
124
</itemizedlist>
125
+
<note>
126
+
<simpara>
127
+
Handling of binary long
128
+
columns is also affected by <function>odbc_longreadlen</function>.
129
+
</simpara>
130
+
</note>
129
131
</para>
130
132
</listitem>
131
133
</varlistentry>
...
...
@@ -135,11 +137,10 @@
135
137
<refsect1 role="returnvalues">
136
138
&reftitle.returnvalues;
137
139
<para>
138
-
&return.success;
140
+
&return.true.always;
139
141
</para>
140
142
</refsect1>
141
143
</refentry>
142
-

143
144
<!-- Keep this comment at the end of the file
144
145
Local variables:
145
146
mode: sgml
146
147