create_assocarray4.sql

来自「介绍Oracle PL SQL编程」· SQL 代码 · 共 41 行

SQL
41
字号
/* * create_assocarray4.sql * Chapter 6, Oracle10g PL/SQL Programming * by Ron Hardman, Michael McLaughlin and Scott Urman * * This script demonstrates you cannot use the Collection API EXTEND method * to allocated space. */SET ECHO ONSET SERVEROUTPUT ON SIZE 1000000DECLARE  -- Define an associative array of strings.  TYPE card_table IS TABLE OF VARCHAR2(5 CHAR)    INDEX BY BINARY_INTEGER;  -- Define an associative array variable.  cards CARD_TABLE;BEGIN  IF cards.COUNT <> 0 THEN    -- Print an element of the cards associative array.    DBMS_OUTPUT.PUT_LINE(cards(1));  ELSE    -- Allocate space like varray and nested tables do.    cards.EXTEND;     -- Print a null element of the cards associative array.--    DBMS_OUTPUT.PUT_LINE(cards(1));  END IF;END;/

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?