dbs             Wed Jan 25 04:26:17 2006 UTC

  Modified files:              
    /phpdoc/en/reference/ibm_db2        constants.xml 
    /phpdoc/en/reference/ibm_db2/functions      db2-bind-param.xml 
  Log:
  Document use of DB2_PARAM_FILE to insert data directly from files.
  
  
http://cvs.php.net/viewcvs.cgi/phpdoc/en/reference/ibm_db2/constants.xml?r1=1.5&r2=1.6&diff_format=u
Index: phpdoc/en/reference/ibm_db2/constants.xml
diff -u phpdoc/en/reference/ibm_db2/constants.xml:1.5 
phpdoc/en/reference/ibm_db2/constants.xml:1.6
--- phpdoc/en/reference/ibm_db2/constants.xml:1.5       Wed Jun 15 01:16:15 2005
+++ phpdoc/en/reference/ibm_db2/constants.xml   Wed Jan 25 04:26:17 2006
@@ -1,5 +1,5 @@
 <?xml version='1.0' encoding='iso-8859-1'?>
-<!-- $Revision: 1.5 $ -->
+<!-- $Revision: 1.6 $ -->
 <!-- Generated by xml_proto.php v2.2. Found in /scripts directory of phpdoc. 
-->
 <section id="ibm-db2.constants">
  &reftitle.constants;
@@ -108,8 +108,7 @@
    </term>
    <listitem>
     <simpara>
-     Specifies that the column should be bound directly to a file for input or
-     output.
+     Specifies that the column should be bound directly to a file for input.
     </simpara>
    </listitem>
   </varlistentry>
http://cvs.php.net/viewcvs.cgi/phpdoc/en/reference/ibm_db2/functions/db2-bind-param.xml?r1=1.9&r2=1.10&diff_format=u
Index: phpdoc/en/reference/ibm_db2/functions/db2-bind-param.xml
diff -u phpdoc/en/reference/ibm_db2/functions/db2-bind-param.xml:1.9 
phpdoc/en/reference/ibm_db2/functions/db2-bind-param.xml:1.10
--- phpdoc/en/reference/ibm_db2/functions/db2-bind-param.xml:1.9        Wed Dec 
 7 16:11:22 2005
+++ phpdoc/en/reference/ibm_db2/functions/db2-bind-param.xml    Wed Jan 25 
04:26:17 2006
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.9 $ -->
+<!-- $Revision: 1.10 $ -->
 <!-- Generated by xml_proto.php v2.2. Found in /scripts directory of phpdoc. 
-->
 <refentry id="function.db2-bind-param">
  <refnamediv>
@@ -68,7 +68,10 @@
        SQL parameter as an input parameter (<literal>DB2_PARAM_IN</literal>),
        an output parameter (<literal>DB2_PARAM_OUT</literal>), or as a
        parameter that accepts input and returns output
-       (<literal>DB2_PARAM_INOUT</literal>).
+       (<literal>DB2_PARAM_INOUT</literal>). To avoid memory overhead, you can
+       also specify <literal>DB2_PARAM_FILE</literal> to bind the PHP variable
+       to the name of a file that contains large object (BLOB, CLOB, or DBCLOB)
+       data.
       </para>
      </listitem>
     </varlistentry>
@@ -242,6 +245,28 @@
 ]]>
     </screen>
    </example>
+   <example>
+    <title>Inserting a binary large object (BLOB) directly from a file</title>
+    <para>
+     The data for large objects are typically stored in files, such as XML
+     documents or audio files. Rather than reading an entire file into a PHP
+     variable, and then binding that PHP variable into an SQL statement, you
+     can avoid some memory overhead by binding the file directly to the input
+     parameter of your SQL statement. The following example demonstrates how
+     to bind a file directly into a BLOB column.
+    </para>
+    <programlisting role="php">
+<![CDATA[
+<?php
+$stmt = db2_prepare($conn, "INSERT INTO animal_pictures(picture) VALUES (?)");
+
+$picture = "/opt/albums/spook/grooming.jpg";
+$rc = db2_bind_param($stmt, 1, "picture", DB2_PARAM_FILE);
+$rc = db2_execute($stmt);
+?>
+]]>
+    </programlisting>
+   </example>
 
   </para>
  </refsect1>

Reply via email to