<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.cubrid.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'ja',
  ),
  'this' => 
  array (
    0 => 'function.cubrid-lob2-export.php',
    1 => 'cubrid_lob2_export',
    2 => 'Export the lob object to a file',
  ),
  'up' => 
  array (
    0 => 'ref.cubrid.php',
    1 => 'CUBRID 関数',
  ),
  'prev' => 
  array (
    0 => 'function.cubrid-lob2-close.php',
    1 => 'cubrid_lob2_close',
  ),
  'next' => 
  array (
    0 => 'function.cubrid-lob2-import.php',
    1 => 'cubrid_lob2_import',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/cubrid/functions/cubrid-lob2-export.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.cubrid-lob2-export" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">cubrid_lob2_export</h1>
  <p class="verinfo">(PECL CUBRID &gt;= 8.4.1)</p><p class="refpurpose"><span class="refname">cubrid_lob2_export</span> &mdash; <span class="dc-title">Export the lob object to a file</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.cubrid-lob2-export-description">
  <h3 class="title">説明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>cubrid_lob2_export</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="parameter">$lob_identifier</code></span>, <span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$file_name</code></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="simpara">
   The <span class="function"><strong>cubrid_lob2_export()</strong></span> function is used to save the
   contents of BLOB/CLOB data to a file. To use this function, you must use
   <span class="function"><a href="function.cubrid-lob2-new.php" class="function">cubrid_lob2_new()</a></span> or fetch a lob object from CUBRID
   database first. If the file already exists, the operation will fail.
   This function will not influence the cursor position of the lob object.
   It operates the entire lob object.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.cubrid-lob2-export-parameters">
 <h3 class="title">パラメータ</h3>
 <dl>
  
   <dt><code class="parameter">lob_identifier</code></dt>
   <dd>
    <span class="simpara">Lob identifier as a result of <span class="function"><a href="function.cubrid-lob2-new.php" class="function">cubrid_lob2_new()</a></span> or get from the result set.</span>
   </dd>
  
  
   <dt><code class="parameter">filename</code></dt>
   <dd>
    <span class="simpara">File name you want to store BLOB/CLOB data. It also supports the path of the file.</span>
   </dd>
  
 </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.cubrid-lob2-export-returnvalues">
  <h3 class="title">戻り値</h3>
  <p class="simpara">
   成功した場合に <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> を、失敗した場合に <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> を返します。
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.cubrid-lob2-export-examples">
  <h3 class="title">例</h3>
  <div class="example" id="example-1">
   <p><strong>例1 <span class="function"><strong>cubrid_lob2_export()</strong></span> example</strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">// Table: test_lob (id INT, contents CLOB)<br /><br /></span><span style="color: #0000BB">$conn </span><span style="color: #007700">= </span><span style="color: #0000BB">cubrid_connect</span><span style="color: #007700">(</span><span style="color: #DD0000">"localhost"</span><span style="color: #007700">, </span><span style="color: #0000BB">33000</span><span style="color: #007700">, </span><span style="color: #DD0000">"demodb"</span><span style="color: #007700">, </span><span style="color: #DD0000">"dba"</span><span style="color: #007700">, </span><span style="color: #DD0000">""</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">cubrid_execute</span><span style="color: #007700">(</span><span style="color: #0000BB">$conn</span><span style="color: #007700">,</span><span style="color: #DD0000">"DROP TABLE if exists doc"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">cubrid_execute</span><span style="color: #007700">(</span><span style="color: #0000BB">$conn</span><span style="color: #007700">,</span><span style="color: #DD0000">"CREATE TABLE doc (id INT, doc_content CLOB)"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">cubrid_execute</span><span style="color: #007700">(</span><span style="color: #0000BB">$conn</span><span style="color: #007700">,</span><span style="color: #DD0000">"INSERT INTO doc VALUES (5,'hello,cubrid')"</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$req </span><span style="color: #007700">= </span><span style="color: #0000BB">cubrid_prepare</span><span style="color: #007700">(</span><span style="color: #0000BB">$conn</span><span style="color: #007700">, </span><span style="color: #DD0000">"select * from doc"</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">cubrid_execute</span><span style="color: #007700">(</span><span style="color: #0000BB">$req</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">cubrid_move_cursor</span><span style="color: #007700">(</span><span style="color: #0000BB">$req</span><span style="color: #007700">, </span><span style="color: #0000BB">1</span><span style="color: #007700">, </span><span style="color: #0000BB">CUBRID_CURSOR_FIRST</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$row </span><span style="color: #007700">= </span><span style="color: #0000BB">cubrid_fetch</span><span style="color: #007700">(</span><span style="color: #0000BB">$req</span><span style="color: #007700">, </span><span style="color: #0000BB">CUBRID_NUM </span><span style="color: #007700">| </span><span style="color: #0000BB">CUBRID_LOB</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">cubrid_lob2_export</span><span style="color: #007700">(</span><span style="color: #0000BB">$row</span><span style="color: #007700">[</span><span style="color: #0000BB">1</span><span style="color: #007700">], </span><span style="color: #DD0000">"doc_3.txt"</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">cubrid_lob2_close</span><span style="color: #007700">(</span><span style="color: #0000BB">$row</span><span style="color: #007700">[</span><span style="color: #0000BB">1</span><span style="color: #007700">]);<br /></span><span style="color: #0000BB">cubrid_disconnect</span><span style="color: #007700">(</span><span style="color: #0000BB">$conn</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.cubrid-lob2-export-seealso">
  <h3 class="title">参考</h3>
  <ul class="simplelist">
  <li><span class="function"><a href="function.cubrid-lob2-new.php" class="function" rel="rdfs-seeAlso">cubrid_lob2_new()</a> - Create a lob object</span></li>
  <li><span class="function"><a href="function.cubrid-lob2-close.php" class="function" rel="rdfs-seeAlso">cubrid_lob2_close()</a> - Close LOB object</span></li>
  <li><span class="function"><a href="function.cubrid-lob2-import.php" class="function" rel="rdfs-seeAlso">cubrid_lob2_import()</a> - Import BLOB/CLOB data from a file</span></li>
  <li><span class="function"><a href="function.cubrid-lob2-bind.php" class="function" rel="rdfs-seeAlso">cubrid_lob2_bind()</a> - Bind a lob object or a string as a lob object to a prepared statement as parameters</span></li>
  </ul>
 </div>


</div><?php manual_footer($setup); ?>