move.sgml
上传用户:blenddy
上传日期:2007-01-07
资源大小:6495k
文件大小:3k
源码类别:

数据库系统

开发平台:

Unix_Linux

  1. <refentry id="SQL-MOVE">
  2.  <refmeta>
  3.   <refentrytitle>
  4.    MOVE
  5.   </refentrytitle>
  6.   <refmiscinfo>SQL - Language Statements</refmiscinfo>
  7.  </refmeta>
  8.  <refnamediv>
  9.   <refname>
  10.    MOVE
  11.   </refname>
  12.   <refpurpose>
  13.    Moves cursor position
  14.   </refpurpose>
  15.  </refnamediv>                
  16.  <refsynopsisdiv>
  17.   <refsynopsisdivinfo>
  18.    <date>1998-09-24</date>
  19.   </refsynopsisdivinfo>
  20.   <synopsis>
  21. MOVE [ <replaceable class="PARAMETER">selector</replaceable> ] [ <replaceable class="PARAMETER">count</replaceable> ] 
  22.     { IN | FROM } <replaceable class="PARAMETER">cursor</replaceable>
  23.     FETCH [ RELATIVE ] [ { [ <replaceable class="PARAMETER">#</replaceable> | ALL | NEXT | PRIOR ] } ] FROM ] <replaceable class="PARAMETER">cursor</replaceable>
  24.   </synopsis>
  25.  </refsynopsisdiv>
  26.  <refsect1 id="R1-SQL-MOVE-1">
  27.   <refsect1info>
  28.    <date>1998-09-24</date>
  29.   </refsect1info>
  30.   <title>
  31.    Description
  32.   </title>
  33.   <para>
  34.    <command>MOVE</command> allows a user to move cursor position a specified
  35.    number of rows.
  36.    <command>MOVE</command> works like the <command>FETCH</command> command,
  37.    but only positions the cursor and does
  38.    not return rows.
  39.   </para>
  40.   <para>
  41.    Refer to the <command>FETCH</command> command for details on syntax and usage.
  42.   </para>
  43.   <refsect2 id="R2-SQL-MOVE-3">
  44.    <refsect2info>
  45.     <date>1998-09-24</date>
  46.    </refsect2info>
  47.    <title>
  48.     Notes
  49.    </title>
  50.    <para>
  51.     <command>MOVE</command> is a <productname>Postgres</productname>
  52.     language extension.
  53.    </para>
  54.    <para>
  55.     Refer to <command>FETCH</command> for a description
  56.     of valid arguments.
  57.     Refer to <command>DECLARE</command> to declare a cursor.
  58.     Refer to <command>BEGIN WORK</command>, <command>COMMIT WORK</command>,
  59.     <command>ROLLBACK WORK</command> statements
  60.     for further information about transactions.
  61.    </para>
  62.   </refsect2>
  63.  </refsect1>
  64.  <refsect1 id="R1-SQL-MOVE-2">
  65.   <title>
  66.    Usage
  67.   </title>
  68.   <para>
  69.    Set up and use a cursor:
  70.    <programlisting>
  71. BEGIN WORK;
  72. DECLARE liahona CURSOR  FOR SELECT * FROM films;
  73. --Skip first 5 rows:
  74. MOVE FORWARD 5 IN liahona;
  75. <computeroutput>
  76. MOVE
  77. </computeroutput>
  78. --Fetch 6th row in the cursor liahona:
  79. FETCH 1 IN liahona;
  80. <computeroutput>
  81. FETCH
  82.   code |title |did| date_prod|kind      |len
  83.   -----+------+---+----------+----------+------
  84.   P_303|48 Hrs|103|1982-10-22|Action    | 01:37
  85.   (1 row)
  86. </computeroutput>
  87. -- close the cursor liahona and commit work:
  88. CLOSE liahona;
  89. COMMIT WORK;
  90.    </programlisting>
  91.   </para>
  92.  </refsect1>
  93.  <refsect1 id="R1-SQL-MOVE-3">
  94.   <title>
  95.    Compatibility
  96.   </title>
  97.   <para>
  98.   </para>
  99.   <refsect2 id="R2-SQL-MOVE-4">
  100.    <refsect2info>
  101.     <date>1998-09-01</date>
  102.    </refsect2info>
  103.    <title>
  104.     SQL92
  105.    </title>
  106.    <para>
  107.     There is no SQL92 <command>MOVE</command> statement. 
  108.     Instead, <acronym>SQL92</acronym> allows
  109.     one to <command>FETCH</command> rows from an absolute cursor position,
  110.     implicitly moving the cursor to the correct place.
  111.    </para>
  112.   </refsect2>
  113.  </refsect1>
  114. </refentry>
  115. <!-- Keep this comment at the end of the file
  116. Local variables:
  117. mode: sgml
  118. sgml-omittag:nil
  119. sgml-shorttag:t
  120. sgml-minimize-attributes:nil
  121. sgml-always-quote-attributes:t
  122. sgml-indent-step:1
  123. sgml-indent-data:t
  124. sgml-parent-document:nil
  125. sgml-default-dtd-file:"../reference.ced"
  126. sgml-exposed-tags:nil
  127. sgml-local-catalogs:"/usr/lib/sgml/catalog"
  128. sgml-local-ecat-files:nil
  129. End:
  130. -->