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 6662051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:20:56+00:00 2026-05-26T02:20:56+00:00

So what i am looking to do is use a web service call to

  • 0

So what i am looking to do is use a web service call to implement an oracle procedure. To be more specific: I what it so that when i put a value into a parameter in my web service and run it, i want that to be the value sent to the procedure in oracle and then after successfully running to return to the web service as true.

What i have currently tried to to is this:

        public bool InsertMachineModels(string MachineModel)
    {
        logger.DebugFormat("FilteredReportInputsDAO.InsertMachineModel({0})", MachineModel);
        bool retVal = true;
        using (OracleConnection conn = new OracleConnection(connectionString))
        {
            using (OracleCommand cmd = new OracleCommand("Admin_Utilities.InsertMachineModel", conn))
            {
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Add("pMachineModel", OracleType.Cursor).Value = Convert.ToString(MachineModel);
                try
                {
                    conn.Open();
                    cmd.ExecuteNonQuery();
                }
                catch (Exception ex)
                {
                    if (IsErrorLogging)
                        logger.Error("FilteredReportInputsDAO.InsertMachineModels() Exception: ", ex);
                    retVal = false;
                }
                finally
                {
                    conn.Close();
                }
            }
        }
        return retVal;
    }

Below you will find my procedure which runs correctly when implemented in sql developer.

   procedure InsertMachineModel( pMachineModel in nvarchar2)
    is
    begin
        insert into machine_models (Machine_model) values (pMachineModel);
        commit;

     Exception when others then
      pb_util.logdata(1, 'Admin_utilities.InsertMachineModel', 'Exception thrown', sqlerrm || ' stack ' || dbms_utility.format_error_backtrace);
      rollback;
      raise;
    end;

What i believe to be the problem is this line in the web service:

cmd.Parameters.Add("pMachineModel", OracleType.Cursor).Value = Convert.ToString(MachineModel);

In my logger it says that a cursor must be implemented as a parameterdirection.output parameter however i do not believe in that case you can take a value and send it to the api, but if i am wrong feel free to correct me.

So i guess my question is: If what i believe to be correct in the statement above about parameterdirection is wrong, what is the correct answer?

Can anyone give me any suggestions as to how to implement what i am attempting to do correctly?

Any help or suggestions are greatly appreciated. Thank you.

  • 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-26T02:20:56+00:00Added an answer on May 26, 2026 at 2:20 am

    I think your problem is in this line:

    cmd.Parameters.Add("pMachineModel", OracleType.Cursor).Value = 
        Convert.ToString(MachineModel);
    

    You’re attempting to add a parameter of type OracleType.Cursor, which isn’t correct or necessary. Try changing the line to this:

    cmd.Parameters.Add("pMachineModel", OracleType.Char).Value = MachineModel;
    

    (There’s also no need for Convert.ToString here – MachineModel is already a String).

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

Sidebar

Related Questions

I am looking for specific guidelines for when to use Web Services frameworks versus
I'm looking for the best URL schema to use for a web app that
Basically i've got a web service that i'm trying to put some kind of
I'm investigating using a scripting language in order to call a web service that
I am looking to use a PHP library for uploading pictures to a web
I'm currently working on building a java web app. I've been looking to use
I'm looking at building some web user controls with an eye toward re-use, but
I'm a web developer looking to move a lot of clients to use authorize.net
I have a java web app that makes back-end use of a third-party web
I've got a Silverlight app that talks to a REST web service using the

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.