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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:32:36+00:00 2026-05-26T23:32:36+00:00

I am VERY new when it comes to stored procedures and .NET, so I

  • 0

I am VERY new when it comes to stored procedures and .NET, so I apologize in advance. I have a stored procedure that I am trying to use and I keep getting this error…”wrong number or types of arguments in call to ‘COPY_ACCOUNT'”. I am not sure why. Below is my stored procedure code followed by my C#.NET code. Any help is GREATLY appreciated. PLEASE.

create or replace procedure abstract_names.copy_account(r_rows_copied out int,
                                                    ar_old_acct in  abn_headings.acct_no%type,
                                                    ar_new_acct in  abn_headings.acct_no%type)
is  
cnt int := 0;
begin
    r_rows_copied := 0;
 for r in (select heading from abn_headings where acct_no = ar_old_acct) loop      
  copy_heading(cnt, ar_old_acct, r.heading, ar_new_acct);
  r_rows_copied := r_rows_copied + cnt; 
end loop;
dbms_output.put_line('called abstract_names.copy_account '||to_char(r_rows_copied));   
return; end;

Then my C#.NET code…

using System.Data.OracleClient;
try
{
    conn.Open();
    OracleCommand cmd = new OracleCommand();

    cmd.Parameters.Add("r_rows_copied", OracleType.Int32).Direction = ParameterDirection.Output;
    cmd.Parameters.Add("ar_from_acct", OracleType.VarChar).Value = accountNumberDropDownList.SelectedValue.ToString();
    cmd.Parameters.Add("ar_to_acct", OracleType.VarChar).Value = copyAccountDDL.SelectedValue.ToString();
    cmd = new OracleCommand("abstract_names.copy_account", conn);
    cmd.CommandType = CommandType.StoredProcedure;
    cmd.ExecuteNonQuery();
    conn.Close();
    /*
    abstract_names.copy_account(r_rows_copied out int,
                        ar_from_acct in  abn_headings.acct_no%type,
                        ar_to_acct in  abn_headings.acct_no%type)
    */
}
finally
{
    if (conn != null)
        conn.Close();
}

My connection string is correct because I use it else where in my code and it works. The commented section is the stored procedure i am trying to use obviously. Please help me!

  • 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-26T23:32:37+00:00Added an answer on May 26, 2026 at 11:32 pm

    Just looking at your code and not being familiar with this OracleCommand object, it looks like you’re creating parameters and then creating a new object in the middle wiping out all your parameter additions. Create a new object from the connection and then add your parameters. Attempting a stab at better code below. Also I would use using statements for any conneciton,commnand objects to ensure they get closed and disposed.

    Edit: Didn’t look too deep, my fault. It looks like the parameter names weren’t matching up in the stored procedure and the .net code. Also since you’re returning a value, I would use the ExecuteScalar method, ExeuteNonQuery won’t return any data.

    cmd = new OracleCommand("abstract_names.copy_account", conn);                      
    cmd.Parameters.Add("r_rows_copied", OracleType.Int32).Direction = ParameterDirection.Output;
    cmd.Parameters.Add("ar_old_acct ", OracleType.VarChar).Value = accountNumberDropDownList.SelectedValue.ToString();
    cmd.Parameters.Add("ar_new_acct", OracleType.VarChar).Value = copyAccountDDL.SelectedValue.ToString();
    cmd.CommandType = CommandType.StoredProcedure;
    object value = cmd.ExecuteScalar();
    conn.Close();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im very new in C++ I have found this post http://msdn.microsoft.com/en-us/magazine/cc163486.aspx and trying to
Suppose I have a very large site like amazon.com. I’d like to use asp.net
I am very new to ASP.NET so I apologize for the naive question but
I've started a new project and they have a very normalized database. everything that
I'm new at Eclipse and the Android applications making so here comes a very
Very new to python and can't understand why this isn't working. I have a
Very new to JQuery and MVC and webdevelopment over all. I'm now trying to
Very new to XSL (and XML for that matter), but I need to step
Very new mobile developer here... I am trying to retrieve a list of tweets
I have a very subtle bug that I'm having trouble identifying. Background: We 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.