Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

PLSQL collection

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

PLSQL collection

Index table (or associative array, associative array)

Nested tables (nested table)

Variable length array (varray)

Two-dimensional array (multi-layer collection)

Index table

-the syntax for creating an index table type is as follows:

TYPE type_name IS TABLE OF element_type

INDEX BY index_type

Table_name TYPE_NAME

Where element_type indicates the type of data stored in the collection

-- index_type specifies the type of subscript. Can only be integer or string

-- use subscripts to refer to a single element in the index table, as follows:

Table_name (index)

-example 1: declare a cursor and an index table type, respectively.

-- retrieve the names of the top 10 students from the student table. Traversal cursor

-- Save each student's name to a collection of index table types

Then take each student's name from the collection and print it on the screen.

Declare-declare cursors, save 10 student names cursor c_student is select last_name from student where rownum

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report