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

Package-wide TYPE for variable declarations

    XMLWordPrintable

Details

    Description

      This tasks is a subtask of MDEV-13139.

      Under terms of this task we'll implement a way to declare SP variables using TYPE declarations from package specifications.

      For example:

      This package specification declares a public data type varchar_array:

      SET sql_mode=ORACLE;
      DELIMITER $$
      CREATE OR REPLACE PACKAGE pkg AS
        TYPE varchar_array IS TABLE OF VARCHAR(2000) INDEX BY INTEGER;
      END;
      $$
      DELIMITER ;
      

      This procedure uses the data type varchar_array using a qualified notation:

      DELIMITER $$
      CREATE OR REPLACE PROCEDURE p1 AS
        v pkg.varchar_array;
      BEGIN
        v(0):='test';
        SELECT v(0);
      END;
      $$
      DELIMITER ;
      

      CALL p1();
      

      +------+
      | v(0) |
      +------+
      | test |
      +------+
      

      Note, this task is only about variables. Stored routine parameters and stored function return values will be implemented separately.

      Attachments

        Activity

          People

            Unassigned Unassigned
            bar Alexander Barkov
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.