Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 909181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:50:06+00:00 2026-05-15T16:50:06+00:00

I am trying to call an external stored procedure (calls an RPG program). I

  • 0

I am trying to call an external stored procedure (calls an RPG program). I keep getting the following error:

“Exception Details: IBM.Data.DB2.iSeries.iDB2SQLErrorException: SQL0104 Token @SSN was not valid. Valid tokens: :.”

Here is my 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();
}

I can’t seem to figure out what is happening or why I am getting the above error. My connection string looks like:

private const string _CONNSTRING = "DataSource=192.168.50.200;DefaultCollection=QMFILES;Naming=sql;UserID=XXX;Password=XXX;";

Could it be a library list issue? The program just references one file that is in the library list. Any suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T16:50:07+00:00Added an answer on May 15, 2026 at 4:50 pm

    Try like this:

    using (var conn = new iDB2Connection(_CONNSTRING)) 
    using (var cmd = conn.CreateCommand())
    { 
        conn.Open();
    
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.CommandText = "MPRLIB.SIGNTIMESHEET";
        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();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently trying to call a method from a utility class that will
I'm pretty new to OCaml and was trying to figure out how to call
Im trying to get console output from an external application in my application. When
I am trying to use IronPython in the browser and attempting to import external
I am trying to implement a search like the one used on the app
I have a function that I want to call from within a class method.
I am trying to put comments on Facebook wall using jquery. But my ajax
I'm trying to put tag into JQuery-ui dialog widget. Due to some other problems
I'm trying to assemble a simple Hello world application with Masm32. It assembles fine
I am trying to create a subversion pre-lock hook on windows. However I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.