ナビゲーション

  • 索引
  • 次へ |
  • 前へ |
  • Database Compatibility Stored Procedural Language Guide 13 ドキュメント »
  • Collection Methods »

NEXT¶

NEXT は、指定された添え字に続く添え字を返すメソッドです。このメソッドは単一の引数を取ります。テストする subscript 。

<collection>.NEXT(<subscript>)

collection はコレクションの名前です。

指定した添え字がコレクション内の最初の添え字より小さい場合、関数は最初の添え字を返します。添え字に後継がない場合、 NEXT は NULL を返します。 NULL 添え字を指定すると、 PRIOR は値を返しません。

次の例では、 NEXT を使用して、連想配列 sparse_arr: の添え字 10 に続く添え字を返します。

DECLARE
    TYPE sparse_arr_typ IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
    sparse_arr      sparse_arr_typ;
BEGIN
    sparse_arr(-100)  := -100;
    sparse_arr(-10)   := -10;
    sparse_arr(0)     := 0;
    sparse_arr(10)    := 10;
    sparse_arr(100)   := 100;
    DBMS_OUTPUT.PUT_LINE('NEXT element: ' || sparse_arr.next(10));
END;

NEXT element: 100

Logo

前のトピックへ

LIMIT

次のトピックへ

PRIOR

クイック検索

目次

  • Basic SPL Elements
  • SPL Programs
  • Variable Declarations
  • Basic Statements
  • Control Structures
  • Transaction Control
  • Dynamic SQL
  • Static Cursors
  • REF CURSORs and Cursor Variables
  • Collections
  • Collection Methods
    • COUNT
    • DELETE
    • EXISTS
    • EXTEND
    • FIRST
    • LAST
    • LIMIT
    • NEXT
    • PRIOR
    • TRIM
  • Working with Collections
  • Triggers
  • Packages
  • Object Types and Objects
  • Errors and Messages
  • Conclusion

ナビゲーション

  • 索引
  • 次へ |
  • 前へ |
  • Database Compatibility Stored Procedural Language Guide 13 ドキュメント »
  • Collection Methods »
  • index
  • next |
  • previous |