title: MYSQL Error 1414 - Error doesnt make sense
body: <p>This is my stored procedure, which works fine on my local machine, but on PRODUCTION, it gives me the above error: Its complaining about the OUT parameter, the last one:</p>
  
  <pre><code>-- --------------------------------------------------------------------------------
  -- Routine DDL
  -- Note: comments before and after the routine body will not be stored by the server
  -- --------------------------------------------------------------------------------
  DELIMITER $$
  
  CREATE DEFINER=`root`@`localhost` PROCEDURE `insert_projects`(
          IN userName varchar(20),
          IN projectName text,
          IN projectDescription text,
          IN projectCurrency text,
          IN projectBudget1 double,
          IN projectBudget2 double,
          IN projectEndDate DATETIME,
          IN expectedDelivDate DATETIME,
          IN projectMessageForBidder text,
          OUT projectCode bigint)
  BEGIN
  
  DECLARE 
      l_project_code bigint;
  
          insert into projects
          (PROJECT_CODE,
           SR_USER_NAME ,
           PROJECT_NAME,
           PROJECT_DESCRIPTION,
           PROJECT_CURRENCY,
           PROJECT_BUDGET1 ,
           PROJECT_BUDGET2 ,
           PROJECT_STATUS,
           PROJECT_END_DATE,
           PROJECT_PAID,
           EXPECTED_DELIV_DATE,
           PROJECT_MESSAGE_FOR_BIDDER,
           PROJECT_CREATION_DATE,
           PROJECT_UPDATE_DATE)
          values
          (
           0,
           userName,
           projectName,
           projectDescription,
           projectCurrency,
           projectBudget1,
           projectBudget2,
           'Active',
           projectEndDate,
           null,
           expectedDelivDate,
           projectMessageForBidder,
           NOW(),
           NOW());
  
           SELECT LAST_INSERT_ID() into l_project_code;
  
           SET projectCode = l_project_code;
  END
  </code></pre>
  
  <p>Below is my C# code, that sets up the parameters :</p>
  
  <pre><code>                MySqlCommand command = new MySqlCommand("insert_projects", dbcontroller.conn);
                  command.CommandType = System.Data.CommandType.StoredProcedure;
  
                  // Add parameters for the insert_projects STORED PROC
                  command.Parameters.Add(new MySqlParameter("userName", SessionBag.Current.UserName));
                  command.Parameters["@userName"].Direction = System.Data.ParameterDirection.Input;
  
                  command.Parameters.Add(new MySqlParameter("projectCode", MySqlDbType.Int64));
                  command.Parameters["@projectCode"].Direction = System.Data.ParameterDirection.Output;
  
                  command.Parameters.Add(new MySqlParameter("projectName", model.projectName));
                  command.Parameters.Add(new MySqlParameter("projectDescription", model.projectDescription));
                  command.Parameters.Add(new MySqlParameter("projectCurrency", model.projectCurrency));
                  command.Parameters.Add(new MySqlParameter("projectBudget1", model.projectBudget1));
                  command.Parameters.Add(new MySqlParameter("projectBudget2", model.projectBudget2));
                  command.Parameters.Add(new MySqlParameter("projectEndDate", model.projectEndDate));
                  command.Parameters.Add(new MySqlParameter("expectedDelivDate", model.expectedDelivDate));
                  command.Parameters.Add(new MySqlParameter("projectMessageForBidder", model.projectMessageForBidder));
  
                  try
                  {
                      command.ExecuteNonQuery();
  
                      TempData["projectCode"] = (Int64)command.Parameters["?projectCode"].Value;
                      TempData["frompage"] = "AddProject";
  
                      dbcontroller.conn.Close();
                      return RedirectToAction("MyProjectsHeaderSR", "Projects");
                  }
  </code></pre>
  
  <p>Why is is complaining about this? My local machine works fine. The table "projects" contains a field called project_code which is set to BIGINT auto-increment... The rest of the fields are normal datatypes.</p>
  
  <p>Ok, I have created a variable .. and passed it in .. same error</p>
  
  <pre><code>            if (dbcontroller.DBConnection())
              {
                  Int64 projectCode = 0;
  
                  MySqlCommand command = new MySqlCommand("insert_projects", dbcontroller.conn);
                  command.CommandType = System.Data.CommandType.StoredProcedure;
  
                  // Add parameters for the insert_projects STORED PROC
                  command.Parameters.Add(new MySqlParameter("userName", SessionBag.Current.UserName));
                  command.Parameters["@userName"].Direction = System.Data.ParameterDirection.Input;
  
                  command.Parameters.Add(new MySqlParameter("projectCode", projectCode));
                  command.Parameters["@projectCode"].Direction = System.Data.ParameterDirection.Output;
  </code></pre>
  
  <p>It still doesnt work </p>