PLSQL_数据结构类型的解析(概念)

2014-06-02 Created By BaoXinjian

一、总论


1. 字段

2. 记录

3. 集合

4. 游标

5. 其他

 

二、具体分析


 1. 字段

(1). 标准字段

    l_wip_entity_id NUMBER;

(2). 基于表字段

    l_wip_entity_id wip_entities.wip_entity_id%TYPE;

 

2. 记录

(1). 标准记录

    TYPE r_type_wip_entity ISRECORD(

        wip_entity_id wip_entities.wip_entity_id%TYPE,

        wip_entity_name wip_entities.wip_entity_name%TYPE

    );

    r_wip_entity  r_type_wip_entity;

(2). 基于表记录

    r_wip_entity   wip_entities%ROWTYPE;

 

3. 集合

(1). 标准集合

    TYPE r_type_wip_entity ISRECORD(

        wip_entity_id wip_entities.wip_entity_id%TYPE,

        wip_entity_name wip_entities.wip_entity_name%TYPE

    );

    r_wip_entity  r_type_wip_entity;

    TYPE c_wip_entity IS TABLE OF r_wip_entity INDEX BY BINARY_INTEGER;

(2). 基于表集合

    TYPE c_wip_entity ISTABLEOF wip_entities%ROWTYPEINDEXBYBINARY_INTEGER;

(3). 集合的操作

  Count / First / Last / Prior /Next / Extend /Delete

 

4. 游标

(1). 标准游标

    CURSOR c_wip_entity

    IS

        SELECT wip_entity_id, wip_entity_name

          FROM wip_entities;

(2). 其他方式定义

    TYPE c_type_wip_entity ISREFCURSOR;

    c_wip_entity c_type_wip_entity;

 

5. 其他

(1). rowid和rownum

(2). BLOD和CLOB

 

Thanks and Regards

原文地址:https://www.cnblogs.com/eastsea/p/3764218.html