Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-10764 PL/SQL parser - Phase 2
  3. MDEV-12334

Allow %ROWTYPE variable fields as SELECT INTO targets

    XMLWordPrintable

Details

    Description

      Under term of this task we'll allow to specify fields of cursor%ROWTYPE and table%ROWTYPE variables as SELECT INTO targets:

      cursor%ROWTYPE field as SELECT INTO targets:

      SET sql_mode=ORACLE;
      DROP PROCEDURE IF EXISTS p1;
      DELIMITER $$
      CREATE PROCEDURE p1 AS
        CURSOR cur IS SELECT 10 as a, 'b1' AS b;
        rec cur%ROWTYPE;
      BEGIN
        SELECT 10,'b1' INTO rec.a, rec.b;
        SELECT rec.a, rec.b;
      END;
      $$
      DELIMITER ;
      CALL p1;
      

      table%ROWTYPE fields as SELECT INTO target:

      SET sql_mode=ORACLE;
      DROP TABLE IF EXISTS t1;
      DROP PROCEDURE IF EXISTS p1;
      CREATE TABLE t1 (a INT, b VARCHAR(10));
      INSERT INTO t1 VALUES (10,'b1');
      DELIMITER $$
      CREATE PROCEDURE p1 AS
        CURSOR cur IS SELECT * FROM t1;
        rec t1%ROWTYPE;
      BEGIN
        SELECT 10,'b1' INTO rec.a, rec.b;
        SELECT rec.a, rec.b;
      END;
      $$
      DELIMITER ;
      CALL p1;
      

      Attachments

        Issue Links

          Activity

            People

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