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

  • Home
  • SEARCH
  • 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 4033586
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:51:54+00:00 2026-05-20T11:51:54+00:00

I seem have come across a short coming with ODBC and DB2 when running

  • 0

I seem have come across a short coming with ODBC and DB2 when running stored procedures. It seems that it is not possible to return data from a stored procedure, and I have a prexisting query that I need to use. Has anyone got around this particular issue?

Thanks in advance

Update

The code that I am calling is as follows (assuming that the connection is already opened):

string BaseSQL = "CALL B6009822.O#04666803.PUT";

OdbcCommand command = new OdbcCommand(BaseSQL, myConnection);
command.CommandType = CommandType.StoredProcedure;

command.Parameters.Add("@Owner", OdbcType.VarChar).Value = "MH";

int rows = command.ExecuteNonQuery();

myConnection.Close();

I get the following error ..

ERROR [HY000] [IBM][System i Access ODBC Driver][DB2 for i5/OS]SQL0440 - Routine PUT in O#04666803 not found with specified parameters.

It seems to be objecting to the catalog/library and procedure name. Any idea on what I need to do to get the procedure called ?

Second Update – real example

string BaseSQL = "{ CALL B6009822.O#04666803.PUT(?,?,?,?,?,?,?,?,?) }";

OdbcCommand command = myConnection.CreateCommand();
command.CommandText = BaseSQL;

//OdbcCommand command = new OdbcCommand(BaseSQL, myConnection);
command.CommandType = CommandType.StoredProcedure;

/*
@Param1 VarChar(4), @Param2 dec(8,0), 
@Param3 dec(4,0), @Param4 dec(8,0),      
@Param5 VarChar(60), @Param6 dec(9,2), 
@Param7 dec(9,0), @Param8 dec(9,2), 
@Param9 VarChar(10))                
 */

command.Parameters.Add("@Param1", OdbcType.VarChar, 4).Value = "MH";
command.Parameters.Add("@Param2", OdbcType.Decimal, 8).Value = 20110217;
command.Parameters.Add("@Param3", OdbcType.Decimal, 4).Value = 1;
command.Parameters.Add("@Param4", OdbcType.Decimal, 8).Value = 178377;
command.Parameters.Add("@Param5", OdbcType.VarChar, 60).Value = "Description";
command.Parameters.Add("@Param6", OdbcType.Decimal, 9).Value = 0;
command.Parameters.Add("@Param7", OdbcType.Decimal, 9).Value = 45;
command.Parameters.Add("@Param8", OdbcType.Decimal, 9).Value = 0;
command.Parameters.Add("@Param9", OdbcType.VarChar, 10).Value = "*CREATE";

int rows = command.ExecuteNonQuery();

myConnection.Close();
  • 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-20T11:51:55+00:00Added an answer on May 20, 2026 at 11:51 am

    First of all I had to make the library (or whatever the proper term is) visible in the “System i Navigator”. It seems that there is an issue with stored procedures that return results, so I had to call it as a SELECT, as shown below …

    "SELECT PUT('{4}',{1},1,{0},'{2}',0,{3},0,'{5}') as A from LIBRARY.EARNER where EAR = '{4}'"
    

    Not sure if this helps anyone else other than me though!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently learning Magento and seem to have come across a problem that is
More often than I'd have hoped I seem to come across method/property definitions in
I have some colors that seem to come from a Delphi TColor variable (e.g
I have come across several solutions here and across the web but none seem
I'm using the org.jboss.logging.Logger class, and seem to have come across an incongruity. When
I'm trying to learn to use ANTLR, and seem to have come across an
I have come across some legacy code that has the following type of line:
I have come across a situation where Tasks I am creating only seem to
Occasionally, I have come across programming techniques that involve creating application frameworks or websites
I seem to have come across several different ways to find the size of

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.