<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.pgsql.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'ja',
  ),
  'this' => 
  array (
    0 => 'function.pg-lo-seek.php',
    1 => 'pg_lo_seek',
    2 => 'ラージオブジェクトの位置をシークする',
  ),
  'up' => 
  array (
    0 => 'ref.pgsql.php',
    1 => 'PostgreSQL 関数',
  ),
  'prev' => 
  array (
    0 => 'function.pg-lo-read-all.php',
    1 => 'pg_lo_read_all',
  ),
  'next' => 
  array (
    0 => 'function.pg-lo-tell.php',
    1 => 'pg_lo_tell',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'ja',
    'path' => 'reference/pgsql/functions/pg-lo-seek.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.pg-lo-seek" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">pg_lo_seek</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.2.0, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">pg_lo_seek</span> &mdash; <span class="dc-title">
   ラージオブジェクトの位置をシークする
  </span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.pg-lo-seek-description">
  <h3 class="title">説明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>pg_lo_seek</strong></span>(<span class="methodparam"><span class="type"><a href="class.pgsql-lob.php" class="type PgSql\Lob">PgSql\Lob</a></span> <code class="parameter">$lob</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$offset</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$whence</code><span class="initializer"> = <strong><code><a href="filesystem.constants.php#constant.seek-cur">SEEK_CUR</a></code></strong></span></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   <span class="function"><strong>pg_lo_seek()</strong></span> は <span class="classname"><a href="class.pgsql-lob.php" class="classname">PgSql\Lob</a></span>
   インスタンスの位置をシークします。
  </p>
  <p class="para">
   ラージオブジェクトインターフェイスは、トランザクションブロックの中で
   使用する必要があります。
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.pg-lo-seek-parameters">
  <h3 class="title">パラメータ</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">lob</code></dt>
     <dd>
      <p class="para"><span class="function"><a href="function.pg-lo-open.php" class="function">pg_lo_open()</a></span> が返した <span class="classname"><a href="class.pgsql-lob.php" class="classname">PgSql\Lob</a></span> クラスのインスタンス。</p>
     </dd>
    
    
     <dt><code class="parameter">offset</code></dt>
     <dd>
      <p class="para">
       シークするバイト数。
      </p>
     </dd>
    
    
     <dt><code class="parameter">whence</code></dt>
     <dd>
      <p class="para">
       定数 <strong><code><a href="pgsql.constants.php#constant.pgsql-seek-set">PGSQL_SEEK_SET</a></code></strong>（オブジェクトの先頭からシークする）、
       <strong><code><a href="pgsql.constants.php#constant.pgsql-seek-cur">PGSQL_SEEK_CUR</a></code></strong>（カレントの位置からシークする）、
       あるいは <strong><code><a href="pgsql.constants.php#constant.pgsql-seek-end">PGSQL_SEEK_END</a></code></strong>（オブジェクトの最後からシークする）
       の中のひとつ。
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.pg-lo-seek-returnvalues">
  <h3 class="title">戻り値</h3>
  <p class="para">
   成功した場合に <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 changelog" id="refsect1-function.pg-lo-seek-changelog">
  <h3 class="title">変更履歴</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>バージョン</th>
      <th>説明</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
 <td>8.1.0</td>
 <td>
  <code class="parameter">lob</code> は、<span class="classname"><a href="class.pgsql-lob.php" class="classname">PgSql\Lob</a></span>
  クラスのインスタンスを期待するようになりました。
  これより前のバージョンでは、<span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> を期待していました。
 </td>
</tr>

    </tbody>
   
  </table>

 </div>

 
 <div class="refsect1 examples" id="refsect1-function.pg-lo-seek-examples">
  <h3 class="title">例</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>例1 <span class="function"><strong>pg_lo_seek()</strong></span> の例</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />   $doc_oid </span><span style="color: #007700">= </span><span style="color: #0000BB">189762345</span><span style="color: #007700">;<br />   </span><span style="color: #0000BB">$database </span><span style="color: #007700">= </span><span style="color: #0000BB">pg_connect</span><span style="color: #007700">(</span><span style="color: #DD0000">"dbname=jacarta"</span><span style="color: #007700">);<br />   </span><span style="color: #0000BB">pg_query</span><span style="color: #007700">(</span><span style="color: #0000BB">$database</span><span style="color: #007700">, </span><span style="color: #DD0000">"begin"</span><span style="color: #007700">);<br />   </span><span style="color: #0000BB">$handle </span><span style="color: #007700">= </span><span style="color: #0000BB">pg_lo_open</span><span style="color: #007700">(</span><span style="color: #0000BB">$database</span><span style="color: #007700">, </span><span style="color: #0000BB">$doc_oid</span><span style="color: #007700">, </span><span style="color: #DD0000">"r"</span><span style="color: #007700">);<br />   </span><span style="color: #FF8000">// 最初の 50000 バイトをスキップする<br />   </span><span style="color: #0000BB">pg_lo_seek</span><span style="color: #007700">(</span><span style="color: #0000BB">$handle</span><span style="color: #007700">, </span><span style="color: #0000BB">50000</span><span style="color: #007700">, </span><span style="color: #0000BB">PGSQL_SEEK_SET</span><span style="color: #007700">);<br />   </span><span style="color: #FF8000">// 次の 10000 バイトを読み込む<br />   </span><span style="color: #0000BB">$data </span><span style="color: #007700">= </span><span style="color: #0000BB">pg_lo_read</span><span style="color: #007700">(</span><span style="color: #0000BB">$handle</span><span style="color: #007700">, </span><span style="color: #0000BB">10000</span><span style="color: #007700">);<br />   </span><span style="color: #0000BB">pg_query</span><span style="color: #007700">(</span><span style="color: #0000BB">$database</span><span style="color: #007700">, </span><span style="color: #DD0000">"commit"</span><span style="color: #007700">);<br />   echo </span><span style="color: #0000BB">$data</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div> 
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.pg-lo-seek-seealso">
  <h3 class="title">参考</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.pg-lo-tell.php" class="function" rel="rdfs-seeAlso">pg_lo_tell()</a> - ラージオブジェクトのカレントのシーク位置を返す</span></li>
   </ul>
  </p>
 </div>

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