mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-28 14:58:55 +00:00

Ignore entities.*.xml git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@329114 c90b9560-bf6c-de11-be94-00142212c4b1
167 lines
4.3 KiB
XML
167 lines
4.3 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
|
|
<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>string</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
|
|
-->
|