Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-35980

Oracle: Nested tables for scalar elements

Details

    Description

      A nested table in is a dynamic, array-like data structure that allows you to store multiple elements of the same data type in a single variable.

      Methods (TODO: add details):

      • COUNT
      • DELETE
      • EXISTS
      • EXTEND
      • FIRST
      • LAST
      • index
      • LIMIT
      • NEXT
      • PRIOR
      • TRIM

      Example:

      DECLARE
        TYPE NameList IS TABLE OF VARCHAR2(10);
       
        names NameList := NameList('John', 'Paul', 'Jorge');
       
        PROCEDURE print_names IS
        BEGIN
          DBMS_OUTPUT.PUT_LINE(names.COUNT || ' values:');
          FOR i IN names.FIRST .. names.LAST LOOP
            DBMS_OUTPUT.PUT_LINE(names(i));
          END LOOP;
          DBMS_OUTPUT.PUT_LINE('---');
        END;
       
      BEGIN 
        print_names();
       
        names(3) := 'Ringo';
        print_names();
       
        names.extend(1);
        names(4) := 'Jorge';
        print_names();
       
        names := NameList('Chuck', 'Bruce');
        print_names();
      END;
      

      3 values:
      John
      Paul
      Jorge
      ---
      3 values:
      John
      Paul
      Ringo
      ---
      4 values:
      John
      Paul
      Ringo
      Jorge
      ---
      2 values:
      Chuck
      Bruce
      ---
      

      Attachments

        Issue Links

          Activity

            There are no comments yet on this issue.

            People

              Unassigned Unassigned
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.