Collections:
Create an Array in PL/SQL in Oracle
How To Create an Array in PL/SQL in Oracle?
✍: FYIcenter.com
If you want create an array data structure, you can use the collection type VARRAY. VARRAY stands for Variable Array. Here is a sample script on how to use VARRAY:
SQL> set serveroutput on; SQL> DECLARE 2 TYPE list IS VARRAY(3) OF VARCHAR(16); 3 domain_list list; 4 BEGIN 5 domain_list := list('google','fyicenter','myspace'); 6 DBMS_OUTPUT.PUT_LINE('Second domain: ' 7 || domain_list(2)); 8 END; 9 / Second domain: fyicenter
As you can see, to define an array variable, you need to create your own array type, and use that type to define array variables.
⇒ Manage Transaction Isolation Levels in Oracle
⇐ Process Query Result in PL/SQL in Oracle
2019-03-08, 2015🔥, 0💬
Popular Posts:
How To Divide Query Output into Multiple Groups with the GROUP BY Clause in SQL Server? Sometimes, y...
How To Query Tables and Loop through the Returning Rows in MySQL? The best way to query tables and l...
How To Generate CREATE TABLE Script on an Existing Table in SQL Server? If you want to know how an e...
How To Drop a Stored Procedure in Oracle? If there is an existing stored procedure and you don't wan...
How To Create a Table Index in Oracle? If you have a table with a lots of rows, and you know that on...