title: Wrong insert in procedure MySQL
body: <p>wrong INSERT in Procedure . This insert add all column without <strong>UserId</strong></p>
  
  <pre><code>----------------------------------------------------------------------------------
  -- Routine DDL
  -- Note: comments before and after the routine body will not be stored by the server
  -- --------------------------------------------------------------------------------
  DELIMITER $$
  DROP PROCEDURE IF EXISTS CreateTable $$
  CREATE PROCEDURE `CreateTable`
  (
      md5 VARCHAR(255),table_name VARCHAR(255),CommentsId INT(11),
      Parent VARCHAR(100), Content TEXT,UserId INT(11), Title VARCHAR(255), 
      Nick VARCHAR(20), IdLength INT(11), suffix INT(11)
  )
  BEGIN
  
  
  
  DECLARE full_table_name varchar(255);
  
  SET @SQL=CONCAT('SELECT COUNT(\'X\') INTO @COUNTER FROM INFORMATION_SCHEMA.COLUMNS ',
              'WHERE TABLE_NAME like \'', table_name, '%\'');
  
  PREPARE stmt FROM @SQL;
  EXECUTE stmt;
  DEALLOCATE PREPARE stmt;
  
      SET full_table_name= table_name;
  
  
      SET @SQL=CONCAT('CREATE TABLE IF NOT EXISTS ', full_table_name, ' LIKE CommentsPattern');
      PREPARE stmt FROM @SQL;
      EXECUTE stmt;
      DEALLOCATE PREPARE stmt;
  
  
  SET @SQL=CONCAT('INSERT INTO ', full_table_name,'(md5,UserId, Parent, Content, CommentsId, Title, Nick,IdLength,suffix)',
          'values(',UserId,',"',md5, '",', Parent, ',"', Content, '",',CommentsId,',"',Title,'","',Nick,'",', IdLength, ',',suffix, ')');
      prepare stmt from @sql;
      execute stmt;
      deallocate prepare stmt;
  
  END
  </code></pre>
  
  <p>I want add this values:</p>
  
  <pre><code>call CreateTable('dcf57shasdsd5723m','dcf',2,60201,'My article is',444,'New Title','Ethan',1,2);
  </code></pre>
  
  <p>Where:</p>
  
  <ol>
  <li><strong>md5</strong> - dfc7shgsnsty3475723m </li>
  <li><strong>table_name</strong> - dfc </li>
  <li><strong>UserId</strong> - 444 </li>
  <li><strong>Title</strong> - New Title </li>
  <li><strong>Nick</strong> - Ethan </li>
  <li><strong>CommentsId</strong> - 2 </li>
  <li><strong>Parent</strong> - 60201 </li>
  <li><strong>IdLength</strong> - 1 </li>
  <li><strong>suffix</strong> - 2 </li>
  <li><strong>Content</strong> -  My article is</li>
  </ol>