Tài liệu PL/SQL User’s Guide and Reference phần 3

Thảo luận trong 'Căn Bản' bắt đầu bởi Thúy Viết Bài, 5/12/13.

  1. Thúy Viết Bài

    Thành viên vàng

    Bài viết:
    198,891
    Được thích:
    173
    Điểm thành tích:
    0
    Xu:
    0Xu
    Defining and Declaring Collections
    To create collections, you define a collection type, then declare collections of that
    type. You can define TABLE and VARRAY types in the declarative part of any
    PL/SQL block, subprogram, or package. For nested tables, use the syntax
    TYPE type_name IS TABLE OF element_type [NOT NULL];
    and for varrays, use the following syntax:
    TYPE type_name IS {VARRAY | VARYING ARRAY} (size_limit)
    OF element_type [NOT NULL];
    where type_name is a type specifier used later to declare collections, size_limit
    is a positive integer literal, and element_type is any PL/SQL datatype except
    BINARY_INTEGER, PLS_INTEGER
    BOOLEAN
    BLOB, CLOB (restriction applies only to varrays)
    LONG, LONG RAW
    NATURAL, NATURALN
    NCHAR, NCLOB, NVARCHAR2
    object types with BLOB or CLOB attributes (restriction applies only to varrays)
    object types with TABLE or VARRAY attributes
    POSITIVE, POSITIVEN
    REF CURSOR
    SIGNTYPE
    STRING
    TABLE
    VARRAY
     

    Các file đính kèm:

Đang tải...