<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->

<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>req_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>
   &return.success;
  </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", "dba", "");

cubrid_execute($conn,"DROP TABLE if exists test_lob");
cubrid_execute($conn,"CREATE TABLE test_lob (id INT, contents CLOB)");

$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
-->
