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

INSERT ... RETURNING <column> INTO <variable>

Details

    Description

      This syntax is used in mostly stored procedures and instead of returniing a result set, see MDEV-10014, the data is returned into a variable, like this:

      CREATE OR REPLACE TABLE t1(c1 INT NOT NULL PRIMARY KEY AUTO_INCREMENT);
       
      DELIMITER //
      CREATE OR REPLACE PROCEDURE p1()
      BEGIN
         DECLARE value INTEGER;
       
         INSERT INTO t1 VALUES(NULL) RETURNING c1 INTO value;
         SELECT value;
      END;
      //
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            karlsson Anders Karlsson
            Votes:
            0 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.