Oracle Array PL/SQL Example

A few days ago I tried to use an Array in Oracle, so I wanted to share here a simple example.
In this small piece of code you can find:

  • declaration of DB Table, Oracle Type with three columns, Array
  • Stored Procedure that writes the given array in the table, in delete-insert
  • code needed to launch and test the procedure generating random input data
  • query used for randomly loading the table

Hope it helps : )

P.S. If you need it, there’s the Oracle Collections and Records Documentation

Source: PL/SQL Object Oriented – TutorialsPoint

Interesting Oracle Type Reading: Steven Feuerstein – Use TREAT to Access Attributes of Object Subtypes

Photo credit: Iconexperience.com