php-doc-en/reference/pgsql/functions/pg-lo-write.xml
Christoph Michael Becker e41806c30b Revert revision(s) 351724 from phpdoc/en/trunk:
Document false and null return types

Cf. <https://news-web.php.net/php.doc.cvs/17645>.


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@351730 c90b9560-bf6c-de11-be94-00142212c4b1
2020-11-28 18:05:44 +00:00

128 lines
3.5 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.2 -->
<refentry xml:id="function.pg-lo-write" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>pg_lo_write</refname>
<refpurpose>Write to a large object</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>int</type><methodname>pg_lo_write</methodname>
<methodparam><type>resource</type><parameter>large_object</parameter></methodparam>
<methodparam><type>string</type><parameter>data</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>len</parameter></methodparam>
</methodsynopsis>
<para>
<function>pg_lo_write</function> writes data into a large object
at the current seek position.
</para>
<para>
To use the large object interface, it is necessary to
enclose it within a transaction block.
</para>
<note>
<para>
This function used to be called <function>pg_lowrite</function>.
</para>
</note>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>large_object</parameter></term>
<listitem>
<para>
PostgreSQL large object (LOB) resource, returned by <function>pg_lo_open</function>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>data</parameter></term>
<listitem>
<para>
The data to be written to the large object. If <parameter>len</parameter> is
specified and is less than the length of <parameter>data</parameter>, only
<parameter>len</parameter> bytes will be written.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>len</parameter></term>
<listitem>
<para>
An optional maximum number of bytes to write. Must be greater than zero
and no greater than the length of <parameter>data</parameter>. Defaults to
the length of <parameter>data</parameter>.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
The number of bytes written to the large object, or &false; on error.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>pg_lo_write</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$doc_oid = 189762345;
$data = "This will overwrite the start of the large object.";
$database = pg_connect("dbname=jacarta");
pg_query($database, "begin");
$handle = pg_lo_open($database, $doc_oid, "w");
$data = pg_lo_write($handle, $data);
pg_query($database, "commit");
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>pg_lo_create</function></member>
<member><function>pg_lo_open</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
-->