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.
2019-03-08, 909👍, 0💬
Popular Posts:
How to download and install SQL Server 2005 Sample Scripts in SQL Server? If you want to learn from ...
How To Format Time Zone in +/-hh:mm Format in SQL Server Transact-SQL? From the previous tutorial, y...
How To Replace NULL Values in Expressions using ISNULL() in SQL Server Transact-SQL? As you learned ...
What Is Oracle in Oracle? Oracle is a company. Oracle is also a database server, which manages data ...
What Happens to Your Transactions When ERROR 1205 Occurred in MySQL? If your transaction receives th...