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

stored procedure outvars not looked up in execute immediate

    XMLWordPrintable

Details

    Description

      CREATE PROCEDURE `getMax`(IN `cTable` VARCHAR(255), IN `cColumn` VARCHAR(255), OUT nMax INT) DETERMINISTIC
      EXECUTE IMMEDIATE CONCAT('SELECT MAX(', cColumn, ') INTO nMax FROM ', cTable);
      Query OK, 0 rows affected (0.001 sec)
       
      call getMax('seq_1_to_100', 'seq', @max);
      ERROR 1327 (42000): Undeclared variable: nMax
      

      Attachments

        Activity

          People

            bar Alexander Barkov
            danblack Daniel Black
            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.