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, 3235🔥, 0💬
Popular Posts:
What Privilege Is Needed for a User to Delete Rows from Tables in Another Schema in Oracle? For a us...
How To Round a Numeric Value To a Specific Precision in SQL Server Transact-SQL? Sometimes you need ...
How to connect SQL Server Management Studio Express to SQL Server 2005 Express in SQL Server? Once y...
How To Install Oracle Database 10g XE in Oracle? To install 10g universal edition, double click, Ora...
How To Start the Command-Line SQL*Plus in Oracle? If you Oracle server or client installed on your w...