Added functions about cubrid lob object

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@326483 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Esen Sagynov 2012-07-06 07:12:18 +00:00
parent 9837cc80c7
commit d345f907bb
21 changed files with 1572 additions and 6 deletions

View file

@ -66,6 +66,15 @@
<entry>CUBRID_OBJECT</entry>
<entry>Get query result an object.</entry>
</row>
<row>
<entry>CUBRID_LOB</entry>
<entry>The constant CUBRID_LOB can be used when you want to operate the
lob object. It can be passed to <function>cubrid_fetch</function>,
<function>cubrid_fetch_row</function>,
<function>cubrid_fetch_array</function>,
<function>cubrid_fetch_assoc</function> and
<function>cubrid_fetch_object</function>.</entry>
</row>
</tbody>
</tgroup>
</table>

View file

@ -31,7 +31,8 @@
</varlistentry>
<varlistentry>
<term><parameter>type</parameter></term>
<listitem><para>Array type of the fetched result CUBRID_NUM, CUBRID_ASSOC, CUBRID_BOTH.</para></listitem>
<listitem><para>Array type of the fetched result CUBRID_NUM, CUBRID_ASSOC,
CUBRID_BOTH. If you need to operate the lob object, you can use CUBRID_LOB.</para></listitem>
</varlistentry>
</variablelist>
</para>
@ -64,6 +65,8 @@ while ($row = cubrid_fetch_array($req, CUBRID_NUM)) {
printf("%-40s %-10s %-6s %-20s\n", $row[0], $row[1], $row[2], $row[3]);
}
// if you want to operate LOB object, you can use cubrid_fetch_array($req, CUBRID_NUM | CUBRID_LOB)
cubrid_close_request($req);
cubrid_disconnect($conn);
@ -89,11 +92,15 @@ Ano Liossia 34000.00 12000 Ano Liosia, Athens, G
</example>
</refsect1>
<refsect1 role="seealso">
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>cubrid_execute</function></member>
<member><function>cubrid_fetch</function></member>
<member><function>cubrid_fetch_row</function></member>
<member><function>cubrid_fetch_assoc</function></member>
<member><function>cubrid_fetch_object</function></member>
</simplelist>
</para>
</refsect1>

View file

@ -12,6 +12,7 @@
<methodsynopsis>
<type>array</type><methodname>cubrid_fetch_assoc</methodname>
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>type</parameter></methodparam>
</methodsynopsis>
<para>
This function returns the associative array, that corresponds to the
@ -24,12 +25,17 @@
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<varlistentry>
<term><parameter>result</parameter></term>
<listitem><para><parameter>result</parameter> comes from a call to <function>cubrid_execute</function></para></listitem>
</varlistentry>
<varlistentry>
<term><parameter>type</parameter></term>
<listitem><para>Type can only be CUBRID_LOB, this parameter will be used
only when you need to operate the lob object.</para></listitem>
</varlistentry>
</variablelist>
</para>
</para>
</refsect1>
<refsect1 role="returnvalues">
@ -58,6 +64,8 @@ while ($row = cubrid_fetch_assoc($req)) {
$row["name"], $row["area"], $row["seats"], $row["address"]);
}
// if you want to operate LOB object, you can use cubrid_fetch_assoc($req, CUBRID_LOB)
cubrid_close_request($req);
cubrid_disconnect($conn);
@ -82,6 +90,19 @@ Ano Liossia 34000.00 12000 Ano Liosia, Athens, G
</example>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>cubrid_execute</function></member>
<member><function>cubrid_fetch</function></member>
<member><function>cubrid_fetch_row</function></member>
<member><function>cubrid_fetch_array</function></member>
<member><function>cubrid_fetch_object</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file

View file

@ -14,6 +14,7 @@
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>class_name</parameter></methodparam>
<methodparam choice="opt"><type>array</type><parameter>params</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>type</parameter></methodparam>
</methodsynopsis>
<para>
This function returns an object with the column names of the result set as
@ -49,6 +50,15 @@
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>type</parameter></term>
<listitem>
<para>
Type can only be CUBRID_LOB, this parameter will be used only when you
need to operate the lob object.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
@ -75,6 +85,8 @@ $res = cubrid_execute($conn, "SELECT * FROM code");
var_dump(cubrid_fetch_object($res));
// if you want to operate LOB object, you can use cubrid_fetch_object($res, CUBRID_LOB)
class demodb_code {
public $s_name = null;
public $f_name = null;
@ -86,6 +98,8 @@ class demodb_code {
var_dump(cubrid_fetch_object($res, "demodb_code"));
// if you want to operate LOB object, you can use cubrid_fetch_object($res, "demodb_code", CUBRID_LOB)
class demodb_code_construct extends demodb_code {
public function __construct($s, $f) {
$this->s_name = $s;
@ -94,6 +108,10 @@ class demodb_code_construct extends demodb_code {
}
var_dump(cubrid_fetch_object($res, 'demodb_code_construct', array('s_name', 'f_name')));
// if you want to operate LOB object, you can use cubrid_fetch_object($res, 'demodb_code_construct', array('s_name', 'f_name'), CUBRID_LOB)
var_dump(cubrid_fetch_object($res));
cubrid_close_request($res);
@ -133,6 +151,19 @@ object(stdClass)#1 (2) {
</example>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>cubrid_execute</function></member>
<member><function>cubrid_fetch</function></member>
<member><function>cubrid_fetch_array</function></member>
<member><function>cubrid_fetch_assoc</function></member>
<member><function>cubrid_fetch_row</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file

View file

@ -12,6 +12,7 @@
<methodsynopsis>
<type>array</type><methodname>cubrid_fetch_row</methodname>
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>type</parameter></methodparam>
</methodsynopsis>
<para>
This function returns a numerical array with the values of the current row
@ -28,6 +29,11 @@
<term><parameter>result</parameter></term>
<listitem><para><parameter>result</parameter> comes from a call to <function>cubrid_execute</function></para></listitem>
</varlistentry>
<varlistentry>
<term><parameter>type</parameter></term>
<listitem><para>Type can only be CUBRID_LOB, this parameter will be used
only when you need to operate the lob object.</para></listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
@ -57,6 +63,8 @@ while ($row = cubrid_fetch_row($req)) {
printf("%-40s %-10s %-6s %-20s\n", $row[0], $row[1], $row[2], $row[3]);
}
// if you want to operate LOB object, you can use cubrid_fetch_row($req, CUBRID_LOB)
cubrid_close_request($req);
cubrid_disconnect($conn);
@ -81,6 +89,19 @@ Ano Liossia 34000.00 12000 Ano Liosia, Athens, G
</example>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>cubrid_execute</function></member>
<member><function>cubrid_fetch</function></member>
<member><function>cubrid_fetch_array</function></member>
<member><function>cubrid_fetch_assoc</function></member>
<member><function>cubrid_fetch_object</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file

View file

@ -29,7 +29,9 @@
</varlistentry>
<varlistentry>
<term><parameter>type</parameter></term>
<listitem><para>Array type of the fetched result CUBRID_NUM, CUBRID_ASSOC, CUBRID_BOTH, CUBRID_OBJECT.</para></listitem>
<listitem><para>Array type of the fetched result CUBRID_NUM, CUBRID_ASSOC,
CUBRID_BOTH, CUBRID_OBJECT. If you want to operate the lob object, you can
use CUBRID_LOB.</para></listitem>
</varlistentry>
</variablelist>
</para>
@ -65,6 +67,8 @@ while ($row = cubrid_fetch($req)) {
$row["name"], $row["area"], $row["seats"], $row["address"]);
}
// if you want to operate lob object, you can use cubrid_fetch($req, CUBRID_LOB)
cubrid_close_request($req);
cubrid_disconnect($conn);
@ -94,6 +98,10 @@ Ano Liossia 34000.00 12000 Ano Liosia, Athens, G
<para>
<simplelist>
<member><function>cubrid_execute</function></member>
<member><function>cubrid_fetch_array</function></member>
<member><function>cubrid_fetch_row</function></member>
<member><function>cubrid_fetch_assoc</function></member>
<member><function>cubrid_fetch_object</function></member>
</simplelist>
</para>
</refsect1>

View file

@ -0,0 +1,135 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 325771 $ -->
<refentry xml:id="function.cubrid-lob2-bind" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>cubrid_lob2_bind</refname>
<refpurpose>Bind a lob object or a string as a lob object to a prepared statement as parameters.</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>cubrid_lob2_bind</methodname>
<methodparam><type>resource</type><parameter>lob_identifier</parameter></methodparam>
<methodparam><type>int</type><parameter>bind_index</parameter></methodparam>
<methodparam><type>mixed</type><parameter>bind_value</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>bind_value_type</parameter></methodparam>
</methodsynopsis>
<para>
The <function>cubrid_lob2_bind</function> function is used to bind BLOB/CLOB datas
to a corresponding question mark placeholder in the SQL statement that was passed
to <function>cubrid_prepare</function>. If <parameter>bind_value_type</parameter>
is not given, string will be "BLOB" as the default. But if you use
<function>cubrid_lob2_new</function> before, <parameter>bind_value_type</parameter>
will be consistent with <parameter>type</parameter> in <function>cubrid_lob2_new</function> as the default.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>req_identifier</parameter></term>
<listitem>
<para>Request identifier as a result of <function>cubrid_prepare</function>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>bind_index</parameter></term>
<listitem>
<para>Location of binding parameters. It starts with 1.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>bind_value</parameter></term>
<listitem>
<para>Actual value for binding.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>bind_value_type</parameter></term>
<listitem>
<para>It must be "BLOB" or "CLOB" and it won't be case-sensitive. If it not be given, the default value is "BLOB".</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&true;, when process is successful.
</para>
<para>
&false;, when process is unsuccessful.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example>
<title><function>cubrid_lob2_bind</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
// Table: test_lob (id INT, contents CLOB)
$conn = cubrid_connect("localhost", 33000, "demodb", "public", "");
$req = cubrid_prepare($conn, "INSERT INTO test_lob VALUES (?, ?)");
cubrid_bind($req,1, 3);
$lob = cubrid_lob2_new($conn, 'CLOB');
cubrid_lob2_bind($req, 2, $lob);
cubrid_execute($req);
cubrid_bind($req, 1, 4);
cubrid_lob2_bind($req, 2, 'CUBRID LOB2 TEST', 'CLOB');
cubrid_execute($req);
cubrid_disconnect($conn);
?>
]]>
</programlisting>
</example>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>cubrid_lob2_new</function></member>
<member><function>cubrid_lob2_close</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,75 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 325771 $ -->
<refentry xml:id="function.cubrid-lob2-close" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>cubrid_lob2_close</refname>
<refpurpose>Close LOB object.</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>cubrid_lob2_close</methodname>
<methodparam><type>resource</type><parameter>lob_identifier</parameter></methodparam>
</methodsynopsis>
<para>
The <function>cubrid_lob2_close</function> function is used to close LOB object
returned from <function>cubrid_lob2_new</function> or get from the result set.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>lob_identifier</parameter></term>
<listitem>
<para>Lob identifier as a result of <function>cubrid_lob2_new</function> or get from the result set.</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&true;, on success.
</para>
<para>
&false;, on failure.
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>cubrid_lob2_new</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,113 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 325771 $ -->
<refentry xml:id="function.cubrid-lob2-export" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>cubrid_lob2_export</refname>
<refpurpose>Export the lob object to a file.</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>cubrid_lob2_export</methodname>
<methodparam><type>resource</type><parameter>lob_identifier</parameter></methodparam>
<methodparam><type>string</type><parameter>file_name</parameter></methodparam>
</methodsynopsis>
<para>
The <function>cubrid_lob2_export</function> function is used to save the
contents of BLOB/CLOB data to a file. To use this function, you must use
<function>cubrid_lob2_new</function> or fetch a lob object from CUBRID
database first. If the file has existed, it will fail. This function will
not influence the cursor position of the lob object. It operates the entire lob object.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>lob_identifier</parameter></term>
<listitem>
<para>Lob identifier as a result of <function>cubrid_lob2_new</function> or get from the result set.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>filename</parameter></term>
<listitem>
<para>File name you want to store BLOB/CLOB data. It also supports the path of the file.</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&true; if the process is successful and &false; for failure.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example>
<title><function>cubrid_lob2_export</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
// Table: test_lob (id INT, contents CLOB)
$conn = cubrid_connect("localhost", 33000, "demodb", "public", "");
$req = cubrid_prepare($conn, "select * from test_lob");
cubrid_move_cursor($req, 3, CUBRID_CURSOR_FIRST);
$row = cubrid_fetch($req, CUBRID_NUM | CUBRID_LOB);
cubrid_lob2_export($row[1], "doc_3.txt");
cubrid_lob2_close($row[1]);
cubrid_disconnect($conn);
?>
]]>
</programlisting>
</example>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>cubrid_lob2_new</function></member>
<member><function>cubrid_lob2_close</function></member>
<member><function>cubrid_lob2_import</function></member>
<member><function>cubrid_lob2_bind</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,115 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 325771 $ -->
<refentry xml:id="function.cubrid-lob2-import" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>cubrid_lob2_import</refname>
<refpurpose>Import BLOB/CLOB data from a file.</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>cubrid_lob2_import</methodname>
<methodparam><type>resource</type><parameter>lob_identifier</parameter></methodparam>
<methodparam><type>string</type><parameter>file_name</parameter></methodparam>
</methodsynopsis>
<para>
The <function>cubrid_lob2_import</function> function is used to save the
contents of BLOB/CLOB data from a file. To use this function, you must use
<function>cubrid_lob2_new</function> or fetch a lob object from CUBRID database
first. If the file has existed, it will fail. This function will not influence
the cursor position of the lob object. It operates the entire lob object.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>lob_identifier</parameter></term>
<listitem>
<para>Lob identifier as a result of <function>cubrid_lob2_new</function> or get from the result set.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>filename</parameter></term>
<listitem>
<para>File name you want to import BLOB/CLOB data. It also supports the path of the file.</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&true; if the process is successful and &false; for failure.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example>
<title><function>cubrid_lob2_export</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$conn = cubrid_connect("localhost", 33000, "demodb", "public", "");
cubrid_execute($conn, "CREATE TABLE test_lob (id INT, contents CLOB)");
$req = cubrid_prepare($conn, "INSERT INTO test_lob (?, ?)");
cubrid_bind($req, 1, 1);
$lob = cubrid_lob2_new($conn, "clob");
cubrid_lob2_import($lob, "doc_1.txt");
cubrid_lob2_bind($req, 2, $lob, 'CLOB'); // or cubrid_lob2_bind($req, 2, $lob);
cubrid_execute($req);
cubrid_lob2_close($lob);
cubrid_disconnect($conn);
?>
]]>
</programlisting>
</example>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>cubrid_lob2_new</function></member>
<member><function>cubrid_lob2_close</function></member>
<member><function>cubrid_lob2_export</function></member>
<member><function>cubrid_lob2_bind</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,84 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 325771 $ -->
<refentry xml:id="function.cubrid-lob2-new" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>cubrid_lob2_new</refname>
<refpurpose>Create a lob object.</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>resource</type><methodname>cubrid_lob2_new</methodname>
<methodparam choice="opt"><type>resource</type><parameter>conn_identifier</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>type</parameter><initializer>"BLOB"</initializer></methodparam>
</methodsynopsis>
<para>
The <function>cubrid_lob2_new</function> function is used to create a lob object (both BLOB and CLOB).
This function should be used before you bind a lob object.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>conn_identifier</parameter></term>
<listitem>
<para>Connection identifier. If the connection identifier is not specified,
the last connection opened by <function>cubrid_connect</function> or
<function>cubrid_connect_with_url</function> is assumed.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>type</parameter></term>
<listitem>
<para>It may be "BLOB" or "CLOB", it won't be case-sensitive. The default value is "BLOB".</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Lob identifier when it is successful.
</para>
<para>
&false; on failure.
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>cubrid_lob2_close</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,167 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 325771 $ -->
<refentry xml:id="function.cubrid-lob2-read" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>cubrid_lob2_read</refname>
<refpurpose>Read from BLOB/CLOB data.</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>cubrid_lob2_read</methodname>
<methodparam><type>resource</type><parameter>lob_identifier</parameter></methodparam>
<methodparam><type>int</type><parameter>len</parameter></methodparam>
</methodsynopsis>
<para>
The <function>cubrid_lob2_read</function> function reads <parameter>len</parameter> bytes from the LOB data, then return it.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>lob_identifier</parameter></term>
<listitem>
<para>Lob identifier as a result of <function>cubrid_lob2_new</function> or get from the result set.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>len</parameter></term>
<listitem>
<para>Length from buffer you want to read from the lob data.</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the contents as a string.
</para>
<para>
&false; when there is no more data.
</para>
<para>
NULL on failure.
</para>
<para>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example>
<title><function>cubrid_lob2_read</function> example 1</title>
<programlisting role="php">
<![CDATA[
<?php
// test_lob (id INT, contents CLOB)
$conn = cubrid_connect("localhost", 33000, "demodb", "public", "");
$req = cubrid_execute($conn, "select * from test_lob");
$row = cubrid_fetch_row($req, CUBRID_LOB);
print "position now is " . cubrid_lob2_tell($row[1]) . "\n";
cubrid_lob2_seek($row[1], 10, CUBRID_CURSOR_FIRST);
print "\nposition after moving forword is " . cubrid_lob2_tell($row[1]) . "\n";
$data = cubrid_lob2_read($lob, 12);
print "\nposition after reading is " . cubrid_lob2_tell($row[1]) . "\n";
print $data . "\n";
cubrid_lob2_seek($row[1], 5, CUBRID_CURSOR_CURRENT);
print "\nposition after moving again is " . cubrid_lob2_tell($row[1]) . "\n";
$data = cubrid_lob2_read($lob, 20);
print $data . "\n";
cubrid_disconnect($conn);
?>
]]>
</programlisting>
</example>
<example>
<title><function>cubrid_lob2_read</function> example 2</title>
<programlisting role="php">
<![CDATA[
<?php
// test_lob (id INT, contents CLOB)
$conn = cubrid_connect("localhost", 33000, "demodb", "public", "");
$req = cubrid_execute($conn, "select * from test_lob");
$row = cubrid_fetch_row($req, CUBRID_LOB);
while (true) {
if ($data = cubrid_lob2_read($lob, 1024)) {
print $data . "\n";
}
elseif ($data === false) {
print "There is no more data\n";
break;
}
else {
print "There must some errors\n";
break;
}
}
cubrid_disconnect($conn);
?>
]]>
</programlisting>
</example>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>cubrid_lob2_write</function></member>
<member><function>cubrid_lob2_seek</function></member>
<member><function>cubrid_lob2_seek64</function></member>
<member><function>cubrid_lob2_tell</function></member>
<member><function>cubrid_lob2_tell64</function></member>
<member><function>cubrid_lob2_size</function></member>
<member><function>cubrid_lob2_size64</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,143 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 325771 $ -->
<refentry xml:id="function.cubrid-lob2-seek" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>cubrid_lob2_seek</refname>
<refpurpose>Move the cursor of a lob object.</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>cubrid_lob2_seek</methodname>
<methodparam><type>resource</type><parameter>lob_identifier</parameter></methodparam>
<methodparam><type>int</type><parameter>offset</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>origin</parameter><initializer>CUBRID_CURSOR_CURRENT</initializer></methodparam>
</methodsynopsis>
<para>
The <function>cubrid_lob2_seek</function> function is used to move the cursor
position of a lob object by the value set in the <parameter>offset</parameter>
argument, to the direction set in the <parameter>origin</parameter> argument.
</para>
<para>
To set the <parameter>origin</parameter> argument, you can use CUBRID_CURSOR_FIRST
to set the cursor position moving forward <parameter>offset</parameter> units from
the first beginning. In this case, <parameter>offset</parameter> must be a positive value.
</para>
<para>
If you use CUBRID_CURSOR_CURRENT for <parameter>origin</parameter>, you can move
forward or backward. and <parameter>offset</parameter> can be positive or negative.
</para>
<para>
If you use CUBRID_CURSOR_LAST for <parameter>origin</parameter>, you can move
backward <parameter>offset</parameter> units from the end of LOB object and
<parameter>offset</parameter> only can be positive.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>lob_identifier</parameter></term>
<listitem>
<para>Lob identifier as a result of <function>cubrid_lob2_new</function> or get from the result set.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>offset</parameter></term>
<listitem>
<para>Number of units you want to move the cursor.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>origin</parameter></term>
<listitem>
<para>This parameter can be the following values:</para>
<para>CUBRID_CURSOR_FIRST: move forward from the first beginning.</para>
<para>CUBRID_CURSOR_CURRENT: move forward or backward from the current position.</para>
<para>CUBRID_CURSOR_LAST: move backward at the end of LOB object.</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&true; if the process is successful and &false; for failure.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example>
<title><function>cubrid_lob2_seek</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
// test_lob (id INT, contents CLOB)
$conn = cubrid_connect("localhost", 33000, "demodb", "public", "");
$req = cubrid_execute($conn, "INSERT INTO test_lob (2, ?)");
$lob = cubrid_lob2_new($conn, 'CLOB');
$len = cubrid_lob2_write($lob, "Hello world");
cubrid_lob2_seek($lob, 0, CUBRID_CURSOR_LAST);
$cubrid_lob2_write($lob, "beautifull");
cubrid_lob2_seek($lob, 15, CUBRID_CURSOR_CURRENT);
$data = cubrid_lob2_read($lob, 5);
cubrid_bind($req, 1, $lob);
cubrid_execute($req);
cubrid_disconnect($conn);
?>
]]>
</programlisting>
</example>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>cubrid_lob2_read</function></member>
<member><function>cubrid_lob2_write</function></member>
<member><function>cubrid_lob2_seek64</function></member>
<member><function>cubrid_lob2_tell</function></member>
<member><function>cubrid_lob2_tell64</function></member>
<member><function>cubrid_lob2_size</function></member>
<member><function>cubrid_lob2_size64</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,142 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 325771 $ -->
<refentry xml:id="function.cubrid-lob2-seek64" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>cubrid_lob2_seek64</refname>
<refpurpose>Move the cursor of a lob object.</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>cubrid_lob2_seek64</methodname>
<methodparam><type>resource</type><parameter>lob_identifier</parameter></methodparam>
<methodparam><type>string</type><parameter>offset</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>origin</parameter><initializer>CUBRID_CURSOR_CURRENT</initializer></methodparam>
</methodsynopsis>
<para>
The <function>cubrid_lob2_seek64</function> function is used to move the cursor
position of a lob object by the value set in the <parameter>offset</parameter>
argument, to the direction set in the <parameter>origin</parameter> argument.
If the <parameter>offset</parameter> you want to move is larger than an integer
data can be stored, you can use this function.
</para>
<para>
To set the <parameter>origin</parameter> argument, you can use CUBRID_CURSOR_FIRST
to set the cursor position moving forward <parameter>offset</parameter> units from
the first beginning. In this case, <parameter>offset</parameter> must be a positive value.
</para>
<para>
If you use CUBRID_CURSOR_CURRENT for <parameter>origin</parameter>, you can move
forward or backward. and <parameter>offset</parameter> can be positive or negative.
</para>
<para>
If you use CUBRID_CURSOR_LAST for <parameter>origin</parameter>, you can move backward
<parameter>offset</parameter> units from the end of LOB object and <parameter>offset</parameter> only can be positive.
</para>
<note>
<para>
If you use this function to move the cursor position of the lob object, you should pass <parameter>offset</parameter> as a string.
</para>
</note>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>lob_identifier</parameter></term>
<listitem>
<para>Lob identifier as a result of <function>cubrid_lob2_new</function> or get from the result set.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>offset</parameter></term>
<listitem>
<para>Number of units you want to move the cursor.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>origin</parameter></term>
<listitem>
<para>This parameter can be the following values:</para>
<para>CUBRID_CURSOR_FIRST: move forward from the first beginning.</para>
<para>CUBRID_CURSOR_CURRENT: move forward or backward from the current position.</para>
<para>CUBRID_CURSOR_LAST: move backward at the end of LOB object.</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&true; if the process is successful and &false; for failure.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example>
<title><function>cubrid_lob2_seek64</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
// test_lob (id INT, contents CLOB)
$conn = cubrid_connect("localhost", 33000, "demodb", "public", "");
$req = cubrid_execute($conn, "select * from test_lob");
$row = cubrid_fetch_row($req, CUBRID_LOB);
$lob = $row[1];
cubrid_lob2_seek($lob, "20101029056306120215", CUBRID_CURSOR_FIRST);
$data = $cubrid_lob2_read($lob, 20);
cubrid_disconnect($conn);
?>
]]>
</programlisting>
</example>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>cubrid_lob2_read</function></member>
<member><function>cubrid_lob2_write</function></member>
<member><function>cubrid_lob2_seek</function></member>
<member><function>cubrid_lob2_tell</function></member>
<member><function>cubrid_lob2_tell64</function></member>
<member><function>cubrid_lob2_size</function></member>
<member><function>cubrid_lob2_size64</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,81 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 325771 $ -->
<refentry xml:id="function.cubrid-lob2-size" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>cubrid_lob2_size</refname>
<refpurpose>Get a lob object's size.</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>int</type><methodname>cubrid_lob2_size</methodname>
<methodparam><type>resource</type><parameter>lob_identifier</parameter></methodparam>
</methodsynopsis>
<para>
The <function>cubrid_lob2_size</function> function is used to get the size of a lob object.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>lob_identifier</parameter></term>
<listitem>
<para>Lob identifier as a result of <function>cubrid_lob2_new</function> or get from the result set.</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
It will return the size of the LOB object when it processes successfully.
</para>
<para>
&false; on failure.
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>cubrid_lob2_read</function></member>
<member><function>cubrid_lob2_write</function></member>
<member><function>cubrid_lob2_seek</function></member>
<member><function>cubrid_lob2_seek64</function></member>
<member><function>cubrid_lob2_tell</function></member>
<member><function>cubrid_lob2_tell64</function></member>
<member><function>cubrid_lob2_size64</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,84 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 325771 $ -->
<refentry xml:id="function.cubrid-lob2-size64" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>cubrid_lob2_size64</refname>
<refpurpose>Get a lob object's size.</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>string</type><methodname>cubrid_lob2_size64</methodname>
<methodparam><type>resource</type><parameter>lob_identifier</parameter></methodparam>
</methodsynopsis>
<para>
The <function>cubrid_lob2_size64</function> function is used to get the
size of a lob object. If the size of a lob object is larger than an
integer data can be stored, you can use this function and it will return
the size as a string.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>lob_identifier</parameter></term>
<listitem>
<para>Lob identifier as a result of <function>cubrid_lob2_new</function> or get from the result set.</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
It will return the size of the LOB object as a string when it processes successfully.
</para>
<para>
&false; on failure.
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>cubrid_lob2_read</function></member>
<member><function>cubrid_lob2_write</function></member>
<member><function>cubrid_lob2_seek</function></member>
<member><function>cubrid_lob2_seek64</function></member>
<member><function>cubrid_lob2_tell</function></member>
<member><function>cubrid_lob2_tell64</function></member>
<member><function>cubrid_lob2_size</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,81 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 325771 $ -->
<refentry xml:id="function.cubrid-lob2-tell" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>cubrid_lob2_tell</refname>
<refpurpose>Tell the cursor position of the LOB object.</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>int</type><methodname>cubrid_lob2_tell</methodname>
<methodparam><type>resource</type><parameter>lob_identifier</parameter></methodparam>
</methodsynopsis>
<para>
The <function>cubrid_lob2_tell</function> function is used to tell the cursor position of the LOB object.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>lob_identifier</parameter></term>
<listitem>
<para>Lob identifier as a result of <function>cubrid_lob2_new</function> or get from the result set.</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
It will return the cursor position on the LOB object when it processes successfully.
</para>
<para>
&false; on failure.
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>cubrid_lob2_read</function></member>
<member><function>cubrid_lob2_write</function></member>
<member><function>cubrid_lob2_seek</function></member>
<member><function>cubrid_lob2_seek64</function></member>
<member><function>cubrid_lob2_tell64</function></member>
<member><function>cubrid_lob2_size</function></member>
<member><function>cubrid_lob2_size64</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,84 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 325771 $ -->
<refentry xml:id="function.cubrid-lob2-tell64" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>cubrid_lob2_tell64</refname>
<refpurpose>Tell the cursor position of the LOB object.</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>string</type><methodname>cubrid_lob2_tell64</methodname>
<methodparam><type>resource</type><parameter>lob_identifier</parameter></methodparam>
</methodsynopsis>
<para>
The <function>cubrid_lob2_tell64</function> function is used to tell the
cursor position of the LOB object. If the size of a lob object is larger
than an integer data can be stored, you can use this function and it will
return the position information as a string.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>lob_identifier</parameter></term>
<listitem>
<para>Lob identifier as a result of <function>cubrid_lob2_new</function> or get from the result set.</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
It will return the cursor position on the LOB object as a string when it processes successfully.
</para>
<para>
&false; on failure.
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>cubrid_lob2_read</function></member>
<member><function>cubrid_lob2_write</function></member>
<member><function>cubrid_lob2_seek</function></member>
<member><function>cubrid_lob2_seek64</function></member>
<member><function>cubrid_lob2_tell</function></member>
<member><function>cubrid_lob2_size</function></member>
<member><function>cubrid_lob2_size64</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,142 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 325771 $ -->
<refentry xml:id="function.cubrid-lob2-write" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>cubrid_lob2_write</refname>
<refpurpose>Write to a lob object.</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>cubrid_lob2_write</methodname>
<methodparam><type>resource</type><parameter>lob_identifier</parameter></methodparam>
<methodparam><type>string</type><parameter>buf</parameter></methodparam>
</methodsynopsis>
<para>
The <function>cubrid_lob2_write</function> function reads as much as data
from <parameter>buf</parameter> and stores it to the LOB object. Note that
this function can only append characters now.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>lob_identifier</parameter></term>
<listitem>
<para>Lob identifier as a result of <function>cubrid_lob2_new</function> or get from the result set.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>buf</parameter></term>
<listitem>
<para>Data that need to be written to the lob object.</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&true; if the process is successful and &false; for failure.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example>
<title><function>cubrid_lob2_write</function> example 1</title>
<programlisting role="php">
<![CDATA[
<?php
// test_lob (id INT, contents CLOB)
$conn = cubrid_connect("localhost", 33000, "demodb", "public", "");
$req = cubrid_prepare($conn, "INSERT INTO test_lob (2, ?)");
$lob = cubrid_lob2_new($conn, 'CLOB');
$len = cubrid_lob2_write($lob, "Hello world");
cubrid_lob2_bind($req, 1, $lob);
cubrid_execute($req);
cubrid_disconnect($conn);
?>
]]>
</programlisting>
</example>
<example>
<title><function>cubrid_lob2_write</function> example 2</title>
<programlisting role="php">
<![CDATA[
<?php
// test_lob (id INT, contents CLOB)
$conn = cubrid_connect("localhost", 33000, "demodb", "public", "");
$req = cubrid_execute($conn, "select * from test_lob");
$row = cubrid_fetch_row($req, CUBRID_LOB);
$lob = $row[1];
cubrid_lob2_seek($lob, 0, CUBRID_CURSOR_LAST);
$pos = cubrid_lob2_tell($lob);
print "pos before write: $pos\n";
cubrid_lob2_write($lob, "Hello world");
$pos = cubrid_lob2_tell($lob);
print "pos after write: $pos\n";
cubrid_disconnect($conn);
?>
]]>
</programlisting>
</example>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>cubrid_lob2_read</function></member>
<member><function>cubrid_lob2_seek</function></member>
<member><function>cubrid_lob2_seek64</function></member>
<member><function>cubrid_lob2_tell</function></member>
<member><function>cubrid_lob2_tell64</function></member>
<member><function>cubrid_lob2_size</function></member>
<member><function>cubrid_lob2_size64</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -23,7 +23,10 @@
<section xml:id="cubrid.resources">
&reftitle.resources;
<para>
There are three resource types used in CUBRID. The first one is the link identifier for a database connection, the second is the a resource which holds the result of a query, and the third a resource which holds the query results of BLOB/CLOB data types.
There are four resource types used in CUBRID. The first one is the link
identifier for a database connection, the second is the a resource which
holds the result of a query, and the last two a resource which holds the
query results of BLOB/CLOB data types.
</para>
<section xml:id="cubrid.resources.connection-identifier">
<title>connection identifier</title>
@ -46,6 +49,13 @@
A LOB identifier returned by <function>cubrid_lob_get</function>.
</para>
</section>
<section xml:id="cubrid.resources.lob2-identifier">
<title>LOB2 identifier</title>
<para>
A LOB identifier returned by <function>cubrid_lob2_new</function> or get
from the result set.
</para>
</section>
</section>

View file

@ -63,6 +63,19 @@
<function name='cubrid_lob_get' from='PECL CUBRID &gt;= 8.3.1'/>
<function name='cubrid_lob_send' from='PECL CUBRID &gt;= 8.3.1'/>
<function name='cubrid_lob_size' from='PECL CUBRID &gt;= 8.3.1'/>
<function name='cubrid_lob2_new' from='PECL CUBRID &gt;= 8.4.1'/>
<function name='cubrid_lob2_bind' from='PECL CUBRID &gt;= 8.4.1'/>
<function name='cubrid_lob2_export' from='PECL CUBRID &gt;= 8.4.1'/>
<function name='cubrid_lob2_import' from='PECL CUBRID &gt;= 8.4.1'/>
<function name='cubrid_lob2_read' from='PECL CUBRID &gt;= 8.4.1'/>
<function name='cubrid_lob2_write' from='PECL CUBRID &gt;= 8.4.1'/>
<function name='cubrid_lob2_tell' from='PECL CUBRID &gt;= 8.4.1'/>
<function name='cubrid_lob2_tell64' from='PECL CUBRID &gt;= 8.4.1'/>
<function name='cubrid_lob2_seek' from='PECL CUBRID &gt;= 8.4.1'/>
<function name='cubrid_lob2_seek64' from='PECL CUBRID &gt;= 8.4.1'/>
<function name='cubrid_lob2_size' from='PECL CUBRID &gt;= 8.4.1'/>
<function name='cubrid_lob2_size64' from='PECL CUBRID &gt;= 8.4.1'/>
<function name='cubrid_lob2_close' from='PECL CUBRID &gt;= 8.4.1'/>
<function name='cubrid_lock_read' from='PECL CUBRID &gt;= 8.3.0'/>
<function name='cubrid_lock_write' from='PECL CUBRID &gt;= 8.3.0'/>
<function name='cubrid_move_cursor' from='PECL CUBRID &gt;= 8.3.0'/>