title: Problems with Executing a DB2 External Stored Procedure
body: <p>I am trying to call an external stored procedure (calls an RPG program). I keep getting the following error:</p>
  
  <blockquote>
    <p>"Exception Details: IBM.Data.DB2.iSeries.iDB2SQLErrorException: SQL0104 Token @SSN was not valid. Valid tokens: :."</p>
  </blockquote>
  
  <p>Here is my code:</p>
  
  <pre><code>using (iDB2Connection conn = new iDB2Connection(_CONNSTRING))
  {
      conn.Open();
  
      string sqlStatement = "MPRLIB.SIGNTIMESHEET (@SSN, @SIGNATURE, @WORKSTATION, @TOTALHOURS, @COMMENT)";
      //string sqlStatement = "MPRLIB.SIGNTIMESHEET (?, ?, ?, ?, ?)";
  
      iDB2Command cmd = conn.CreateCommand();
      cmd.CommandType = CommandType.StoredProcedure;
      cmd.CommandText = sqlStatement;
      cmd.Parameters.Add("@SSN", timesheet.EmployeeUniqueKey.ToString("0000000000"));
      cmd.Parameters.Add("@SIGNATURE", timesheet.EmployeeTypedName);
      cmd.Parameters.Add("@WORKSTATION", timesheet.EmployeeSignedComputer);
      cmd.Parameters.Add("@TOTALHOURS", GetJobHoursTotal(timesheet.Id).ToString("00000.000").Replace(".", ""));
      cmd.Parameters.Add("@COMMENT", timesheet.EmployeeComments);
  
      cmd.ExecuteNonQuery();
      conn.Close();
  }
  </code></pre>
  
  <p>I can't seem to figure out what is happening or why I am getting the above error. My connection string looks like:</p>
  
  <pre><code>private const string _CONNSTRING = "DataSource=192.168.50.200;DefaultCollection=QMFILES;Naming=sql;UserID=XXX;Password=XXX;";
  </code></pre>
  
  <p>Could it be a library list issue? The program just references one file that is in the library list. Any suggestions?</p>