{"id":2966,"date":"2019-08-16T21:33:59","date_gmt":"2019-08-17T04:33:59","guid":{"rendered":"https:\/\/oracletutorial.com\/?page_id=2966"},"modified":"2024-03-06T04:11:31","modified_gmt":"2024-03-06T11:11:31","slug":"pl-sql-associative-array","status":"publish","type":"page","link":"https:\/\/www.oracletutorial.com\/plsql-tutorial\/pl-sql-associative-array\/","title":{"rendered":"PL\/SQL Associative Array"},"content":{"rendered":"\n<p><strong>Summary<\/strong>: in this tutorial, you will learn about Oracle PL\/SQL associative arrays including declaring arrays, populating values, and iterating over their elements.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='introduction-to-oracle-plsql-associative-arrays'>Introduction to Oracle PL\/SQL associative arrays <a href=\"#introduction-to-oracle-plsql-associative-arrays\" class=\"anchor\" id=\"introduction-to-oracle-plsql-associative-arrays\" title=\"Anchor for Introduction to Oracle PL\/SQL associative arrays\">#<\/a><\/h2>\n\n\n\n<p>Associative arrays are single-dimensional, unbounded, sparse collections of homogeneous elements.<\/p>\n\n\n\n<p>First, an associative array is single-dimensional. It means that an associative array has a single column of data in each row, which is similar to a one-dimensional array.<\/p>\n\n\n\n<p>Second, an associative array is unbounded, meaning that it has a predetermined limited number of elements.<\/p>\n\n\n\n<p>Third, an associative array is sparse because its elements are not sequential. In other words, an associative array may have gaps between elements.<\/p>\n\n\n\n<p>Finally, an associative array has elements that have the same data type, or we call them homogenous elements.<\/p>\n\n\n\n<p class=\"note\">Note that associative arrays were known as PL\/SQL tables in Oracle 7, and index-by tables in Oracle 8 and 8i. Their names were changed to associative arrays in Oracle 9i release 1.<\/p>\n\n\n\n<p>An associative array can be indexed by numbers or characters.<\/p>\n\n\n\n<p>Declaring an associative array is a two-step process. First, you declare an associative array type. Then, you declare an associative array variable of that type.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='declaring-an-associative-array-type'>Declaring an associative array type <a href=\"#declaring-an-associative-array-type\" class=\"anchor\" id=\"declaring-an-associative-array-type\" title=\"Anchor for Declaring an associative array type\">#<\/a><\/h2>\n\n\n\n<p>The following shows the syntax for declaring an associative array type:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"PostgreSQL SQL dialect and PL\/pgSQL\" data-shcb-language-slug=\"pgsql\"><span><code class=\"hljs language-pgsql\"><span class=\"hljs-keyword\">TYPE<\/span> associative_array_type \n    <span class=\"hljs-keyword\">IS<\/span> <span class=\"hljs-keyword\">TABLE<\/span> <span class=\"hljs-keyword\">OF<\/span> datatype &#91;<span class=\"hljs-keyword\">NOT<\/span> <span class=\"hljs-keyword\">NULL<\/span>]\n    <span class=\"hljs-keyword\">INDEX<\/span> <span class=\"hljs-keyword\">BY<\/span> index_type;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PostgreSQL SQL dialect and PL\/pgSQL<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">pgsql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>In this syntax:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The <code>associative_array_type<\/code> is the name of the associative array type.<\/li>\n\n\n\n<li>The <code>datatype<\/code> is the data type of the elements in the array.<\/li>\n\n\n\n<li>The <code>index_type<\/code> is the data type of the index used to organize the elements in the array.<\/li>\n\n\n\n<li>Optionally, you can specify <code>NOT NULL<\/code> to force every element in the array must have a value.<\/li>\n<\/ul>\n\n\n\n<p>The following example declares an associative array of characters indexed by characters:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"PostgreSQL SQL dialect and PL\/pgSQL\" data-shcb-language-slug=\"pgsql\"><span><code class=\"hljs language-pgsql\"><span class=\"hljs-keyword\">TYPE<\/span> t_capital_type \n    <span class=\"hljs-keyword\">IS<\/span> <span class=\"hljs-keyword\">TABLE<\/span> <span class=\"hljs-keyword\">OF<\/span> VARCHAR2(<span class=\"hljs-number\">100<\/span>) \n    <span class=\"hljs-keyword\">INDEX<\/span> <span class=\"hljs-keyword\">BY<\/span> VARCHAR2(<span class=\"hljs-number\">50<\/span>);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PostgreSQL SQL dialect and PL\/pgSQL<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">pgsql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\" id='declaring-an-associative-array-variable'>Declaring an associative array variable <a href=\"#declaring-an-associative-array-variable\" class=\"anchor\" id=\"declaring-an-associative-array-variable\" title=\"Anchor for Declaring an associative array variable\">#<\/a><\/h2>\n\n\n\n<p>After having the associative array type, you need to declare an associative array variable of that type by using this syntax:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"PostgreSQL SQL dialect and PL\/pgSQL\" data-shcb-language-slug=\"pgsql\"><span><code class=\"hljs language-pgsql\">associative_array associative_array_type <\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PostgreSQL SQL dialect and PL\/pgSQL<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">pgsql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>For example, this statement declares an associative array <code>t_capital<\/code> with the type <code>t_capital_type<\/code>:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"PostgreSQL SQL dialect and PL\/pgSQL\" data-shcb-language-slug=\"pgsql\"><span><code class=\"hljs language-pgsql\">t_capital t_capital_type;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PostgreSQL SQL dialect and PL\/pgSQL<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">pgsql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\" id='accessing-associative-array-elements'>Accessing associative array elements <a href=\"#accessing-associative-array-elements\" class=\"anchor\" id=\"accessing-associative-array-elements\" title=\"Anchor for Accessing associative array elements\">#<\/a><\/h2>\n\n\n\n<p>To access an array element, you use this syntax:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"PostgreSQL SQL dialect and PL\/pgSQL\" data-shcb-language-slug=\"pgsql\"><span><code class=\"hljs language-pgsql\">array_name(<span class=\"hljs-keyword\">index<\/span>)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PostgreSQL SQL dialect and PL\/pgSQL<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">pgsql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Note that <code>index<\/code> can be a number or a character string.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='assigning-associative-array-elements'>Assigning associative array elements <a href=\"#assigning-associative-array-elements\" class=\"anchor\" id=\"assigning-associative-array-elements\" title=\"Anchor for Assigning associative array elements\">#<\/a><\/h2>\n\n\n\n<p>To assign a value to an associative array element, you use the assignment operation (<code>:=<\/code>):<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"PostgreSQL SQL dialect and PL\/pgSQL\" data-shcb-language-slug=\"pgsql\"><span><code class=\"hljs language-pgsql\">array_name(<span class=\"hljs-keyword\">index<\/span>) := <span class=\"hljs-keyword\">value<\/span>;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PostgreSQL SQL dialect and PL\/pgSQL<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">pgsql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\" id='oracle-plsql-associative-array-example'>Oracle PL\/SQL associative array example <a href=\"#oracle-plsql-associative-array-example\" class=\"anchor\" id=\"oracle-plsql-associative-array-example\" title=\"Anchor for Oracle PL\/SQL associative array example\">#<\/a><\/h2>\n\n\n\n<p>The following anonymous block shows how to declare an associative array and assign values to its elements:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"PostgreSQL SQL dialect and PL\/pgSQL\" data-shcb-language-slug=\"pgsql\"><span><code class=\"hljs language-pgsql\"><span class=\"hljs-keyword\">DECLARE<\/span>\n    <span class=\"hljs-comment\">-- declare an associative array type<\/span>\n    <span class=\"hljs-keyword\">TYPE<\/span> t_capital_type \n        <span class=\"hljs-keyword\">IS<\/span> <span class=\"hljs-keyword\">TABLE<\/span> <span class=\"hljs-keyword\">OF<\/span> VARCHAR2(<span class=\"hljs-number\">100<\/span>) \n        <span class=\"hljs-keyword\">INDEX<\/span> <span class=\"hljs-keyword\">BY<\/span> VARCHAR2(<span class=\"hljs-number\">50<\/span>);\n    <span class=\"hljs-comment\">-- declare a variable of the t_capital_type<\/span>\n    t_capital t_capital_type;\n<span class=\"hljs-keyword\">BEGIN<\/span>\n    \n    t_capital(<span class=\"hljs-string\">'USA'<\/span>)            := <span class=\"hljs-string\">'Washington, D.C.'<\/span>;\n    t_capital(<span class=\"hljs-string\">'United Kingdom'<\/span>) := <span class=\"hljs-string\">'London'<\/span>;\n    t_capital(<span class=\"hljs-string\">'Japan'<\/span>)          := <span class=\"hljs-string\">'Tokyo'<\/span>;\n    \n<span class=\"hljs-keyword\">END<\/span>;\n\/<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PostgreSQL SQL dialect and PL\/pgSQL<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">pgsql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\" id='associative-array-methods'>Associative array methods <a href=\"#associative-array-methods\" class=\"anchor\" id=\"associative-array-methods\" title=\"Anchor for Associative array methods\">#<\/a><\/h2>\n\n\n\n<p>Associative arrays have a number of useful methods for accessing array element indexes and manipulating elements effectively.<\/p>\n\n\n\n<p>To call a method you use the following syntax:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-8\" data-shcb-language-name=\"PostgreSQL SQL dialect and PL\/pgSQL\" data-shcb-language-slug=\"pgsql\"><span><code class=\"hljs language-pgsql\">array_name.method_name(parameters);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PostgreSQL SQL dialect and PL\/pgSQL<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">pgsql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>This syntax is similar to the syntax of calling a method in C# and Java.<\/p>\n\n\n\n<p>In this tutorial, we introduce you to two useful methods called <code>FIRST<\/code> and <code>NEXT(n)<\/code>.<\/p>\n\n\n\n<p>The method <code>FIRST<\/code> returns the first index of the array. If an array is empty, the <code>FIRST<\/code> method returns <code>NULL<\/code>.<\/p>\n\n\n\n<p>The method <code>NEXT(n)<\/code> returns the index that succeeds the index <code>n<\/code>. If <code>n<\/code> has no successor, then the <code>NEXT(n)<\/code> returns <code>NULL<\/code>.<\/p>\n\n\n\n<p>The <code>FIRST<\/code> and <code>NEXT(n)<\/code> methods are useful in iterating over the elements of an array using a <code><a href=\"https:\/\/www.oracletutorial.com\/plsql-tutorial\/plsql-while-loop\/\">WHILE<\/a><\/code> loop:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-9\" data-shcb-language-name=\"PostgreSQL SQL dialect and PL\/pgSQL\" data-shcb-language-slug=\"pgsql\"><span><code class=\"hljs language-pgsql\">l_index := array_name.FIRST;\n\n<span class=\"hljs-keyword\">WHILE<\/span> l_index <span class=\"hljs-keyword\">IS<\/span> <span class=\"hljs-keyword\">NOT<\/span> <span class=\"hljs-keyword\">NULL<\/span> <span class=\"hljs-keyword\">LOOP<\/span>\n    <span class=\"hljs-comment\">-- access the array element<\/span>\n    <span class=\"hljs-comment\">-- array_name(l_index)<\/span>\n    l_index := array_name.NEXT(l_index);\n<span class=\"hljs-keyword\">END<\/span> <span class=\"hljs-keyword\">LOOP<\/span>;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-9\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PostgreSQL SQL dialect and PL\/pgSQL<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">pgsql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\" id='putting-it-all-together'>Putting it all together <a href=\"#putting-it-all-together\" class=\"anchor\" id=\"putting-it-all-together\" title=\"Anchor for Putting it all together\">#<\/a><\/h2>\n\n\n\n<p>The following anonymous block illustrates how to declare an associative array, populate its elements, and iterate over the array elements:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-10\" data-shcb-language-name=\"PostgreSQL SQL dialect and PL\/pgSQL\" data-shcb-language-slug=\"pgsql\"><span><code class=\"hljs language-pgsql\"><span class=\"hljs-keyword\">DECLARE<\/span>\n    <span class=\"hljs-comment\">-- declare an associative array type<\/span>\n    <span class=\"hljs-keyword\">TYPE<\/span> t_capital_type \n        <span class=\"hljs-keyword\">IS<\/span> <span class=\"hljs-keyword\">TABLE<\/span> <span class=\"hljs-keyword\">OF<\/span> VARCHAR2(<span class=\"hljs-number\">100<\/span>) \n        <span class=\"hljs-keyword\">INDEX<\/span> <span class=\"hljs-keyword\">BY<\/span> VARCHAR2(<span class=\"hljs-number\">50<\/span>);\n    <span class=\"hljs-comment\">-- declare a variable of the t_capital_type<\/span>\n    t_capital t_capital_type;\n    <span class=\"hljs-comment\">-- local variable<\/span>\n    l_country VARCHAR2(<span class=\"hljs-number\">50<\/span>);\n<span class=\"hljs-keyword\">BEGIN<\/span>\n    \n    t_capital(<span class=\"hljs-string\">'USA'<\/span>)            := <span class=\"hljs-string\">'Washington, D.C.'<\/span>;\n    t_capital(<span class=\"hljs-string\">'United Kingdom'<\/span>) := <span class=\"hljs-string\">'London'<\/span>;\n    t_capital(<span class=\"hljs-string\">'Japan'<\/span>)          := <span class=\"hljs-string\">'Tokyo'<\/span>;\n    \n    l_country := t_capital.FIRST;\n    \n    <span class=\"hljs-keyword\">WHILE<\/span> l_country <span class=\"hljs-keyword\">IS<\/span> <span class=\"hljs-keyword\">NOT<\/span> <span class=\"hljs-keyword\">NULL<\/span> <span class=\"hljs-keyword\">LOOP<\/span>\n        dbms_output.put_line(<span class=\"hljs-string\">'The capital of '<\/span> || \n            l_country || \n            <span class=\"hljs-string\">' is '<\/span> || \n            t_capital(l_country));\n        l_country := t_capital.NEXT(l_country);\n    <span class=\"hljs-keyword\">END<\/span> <span class=\"hljs-keyword\">LOOP<\/span>;\n<span class=\"hljs-keyword\">END<\/span>;\n\/<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-10\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PostgreSQL SQL dialect and PL\/pgSQL<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">pgsql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Here is the output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-11\" data-shcb-language-name=\"plaintext\" data-shcb-language-slug=\"plaintext\"><span><code class=\"hljs language-plaintext\">The capital of Japan is Tokyo\nThe capital of USA is Washington, D.C.\nThe capital of United Kingdom is London<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-11\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">plaintext<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">plaintext<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>In this tutorial, you have learned about Oracle PL\/SQL associative arrays including declaring arrays, populating values, and iterating over their elements.<\/p>\n<div class=\"helpful-block-content\" data-title=\"\">\n\t<header>\n\t\t<div class=\"wth-question\">Was this tutorial helpful?<\/div>\n\t\t<div class=\"wth-thumbs\">\n\t\t\t<button\n\t\t\t\tdata-post=\"2966\"\n\t\t\t\tdata-post-url=\"https:\/\/www.oracletutorial.com\/plsql-tutorial\/pl-sql-associative-array\/\"\n\t\t\t\tdata-post-title=\"PL\/SQL Associative Array\"\n\t\t\t\tdata-response=\"1\"\n\t\t\t\tclass=\"wth-btn-rounded wth-yes-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\tclass=\"feather feather-thumbs-up block w-full h-full\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> Yes <\/span>\n\t\t\t<\/button>\n\n\t\t\t<button\n\t\t\t\tdata-response=\"0\"\n\t\t\t\tdata-post=\"2966\"\n\t\t\t\tdata-post-url=\"https:\/\/www.oracletutorial.com\/plsql-tutorial\/pl-sql-associative-array\/\"\n\t\t\t\tdata-post-title=\"PL\/SQL Associative Array\"\n\t\t\t\tclass=\"wth-btn-rounded wth-no-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> No <\/span>\n\t\t\t<\/button>\n\t\t<\/div>\n\t<\/header>\n\n\t<div class=\"wth-form hidden\">\n\t\t<div class=\"wth-form-wrapper\">\n\t\t\t<div class=\"wth-title\"><\/div>\n\t\t\t\n\t\t\t<textarea class=\"wth-message\"><\/textarea>\n\n\t\t\t<button class=\"btn btn-primary wth-btn-submit\">Send<\/button>\n\t\t\t<button class=\"btn wth-btn-cancel\">Cancel<\/button>\n\t\t\n\t\t<\/div>\n\t<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial introduces you to Oracle PL\/SQL Associative Arrays including declaring arrays, populating values, and iterating over their elements.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1418,"menu_order":41,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-2966","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Oracle PL\/SQL Associative Arrays<\/title>\n<meta name=\"description\" content=\"Introduce you to Oracle PL\/SQL Associative Arrays including declaring arrays, populating values, and iterating over their elements.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.oracletutorial.com\/plsql-tutorial\/pl-sql-associative-array\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Oracle PL\/SQL Associative Arrays\" \/>\n<meta property=\"og:description\" content=\"Introduce you to Oracle PL\/SQL Associative Arrays including declaring arrays, populating values, and iterating over their elements.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.oracletutorial.com\/plsql-tutorial\/pl-sql-associative-array\/\" \/>\n<meta property=\"og:site_name\" content=\"Oracle Tutorial\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-06T11:11:31+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.oracletutorial.com\\\/plsql-tutorial\\\/pl-sql-associative-array\\\/\",\"url\":\"https:\\\/\\\/www.oracletutorial.com\\\/plsql-tutorial\\\/pl-sql-associative-array\\\/\",\"name\":\"Oracle PL\\\/SQL Associative Arrays\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.oracletutorial.com\\\/#website\"},\"datePublished\":\"2019-08-17T04:33:59+00:00\",\"dateModified\":\"2024-03-06T11:11:31+00:00\",\"description\":\"Introduce you to Oracle PL\\\/SQL Associative Arrays including declaring arrays, populating values, and iterating over their elements.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.oracletutorial.com\\\/plsql-tutorial\\\/pl-sql-associative-array\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.oracletutorial.com\\\/plsql-tutorial\\\/pl-sql-associative-array\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.oracletutorial.com\\\/plsql-tutorial\\\/pl-sql-associative-array\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.oracletutorial.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PL\\\/SQL Tutorial\",\"item\":\"https:\\\/\\\/www.oracletutorial.com\\\/plsql-tutorial\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"PL\\\/SQL Associative Array\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.oracletutorial.com\\\/#website\",\"url\":\"https:\\\/\\\/www.oracletutorial.com\\\/\",\"name\":\"Oracle Tutorial\",\"description\":\"Oracle Tutorial\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.oracletutorial.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Oracle PL\/SQL Associative Arrays","description":"Introduce you to Oracle PL\/SQL Associative Arrays including declaring arrays, populating values, and iterating over their elements.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.oracletutorial.com\/plsql-tutorial\/pl-sql-associative-array\/","og_locale":"en_US","og_type":"article","og_title":"Oracle PL\/SQL Associative Arrays","og_description":"Introduce you to Oracle PL\/SQL Associative Arrays including declaring arrays, populating values, and iterating over their elements.","og_url":"https:\/\/www.oracletutorial.com\/plsql-tutorial\/pl-sql-associative-array\/","og_site_name":"Oracle Tutorial","article_modified_time":"2024-03-06T11:11:31+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.oracletutorial.com\/plsql-tutorial\/pl-sql-associative-array\/","url":"https:\/\/www.oracletutorial.com\/plsql-tutorial\/pl-sql-associative-array\/","name":"Oracle PL\/SQL Associative Arrays","isPartOf":{"@id":"https:\/\/www.oracletutorial.com\/#website"},"datePublished":"2019-08-17T04:33:59+00:00","dateModified":"2024-03-06T11:11:31+00:00","description":"Introduce you to Oracle PL\/SQL Associative Arrays including declaring arrays, populating values, and iterating over their elements.","breadcrumb":{"@id":"https:\/\/www.oracletutorial.com\/plsql-tutorial\/pl-sql-associative-array\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.oracletutorial.com\/plsql-tutorial\/pl-sql-associative-array\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.oracletutorial.com\/plsql-tutorial\/pl-sql-associative-array\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.oracletutorial.com\/"},{"@type":"ListItem","position":2,"name":"PL\/SQL Tutorial","item":"https:\/\/www.oracletutorial.com\/plsql-tutorial\/"},{"@type":"ListItem","position":3,"name":"PL\/SQL Associative Array"}]},{"@type":"WebSite","@id":"https:\/\/www.oracletutorial.com\/#website","url":"https:\/\/www.oracletutorial.com\/","name":"Oracle Tutorial","description":"Oracle Tutorial","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.oracletutorial.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/www.oracletutorial.com\/wp-json\/wp\/v2\/pages\/2966","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.oracletutorial.com\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.oracletutorial.com\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.oracletutorial.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.oracletutorial.com\/wp-json\/wp\/v2\/comments?post=2966"}],"version-history":[{"count":0,"href":"https:\/\/www.oracletutorial.com\/wp-json\/wp\/v2\/pages\/2966\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/www.oracletutorial.com\/wp-json\/wp\/v2\/pages\/1418"}],"wp:attachment":[{"href":"https:\/\/www.oracletutorial.com\/wp-json\/wp\/v2\/media?parent=2966"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}