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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:57:35+00:00 2026-06-18T15:57:35+00:00

I have two procedures in a package (TEST_PAK) that are overloaded on Oracle 9i.

  • 0

I have two procedures in a package (TEST_PAK) that are overloaded on Oracle 9i. One takes a string and one takes an array as parameters. The problem i run into is when i try to call with null as a parameter. I am using C# and ODP.NET to call the procedures.

Here’s the head of the two procs:

PROCEDURE get_requests_with_files
(
    o_results OUT sys_refcursor, 
    in_communicator IN VARCHAR2, 
    in_state        IN VARCHAR2  -- State of requests wanted (use NULL for ALL records)
)

and

PROCEDURE get_requests_with_files
(
     o_results OUT SYS_REFCURSOR,    
     in_communicator IN VARCHAR2,    
     in_states       IN flagTableType 
)

The flagTypeTable is how i pass in a PLSQLAssociativeArray to my procedure and not really a part of the problem (i think).

Here’s the C# code i use to call the proc.

private static DataSet GetRequests(String consumer, List<string> states)
{
    try
    {
        const string query = "TEST_PAK.get_requests_with_files";

        var retVal = new DataSet();
        var oComm = new OracleCommand(query, _oConn);
        var oDa = new OracleDataAdapter(oComm);
        oComm.CommandType = CommandType.StoredProcedure;
        oComm.CommandTimeout = CommandTimeout;

        //Parameters

        oComm.Parameters.Add("o_results", OracleDbType.RefCursor);
        oComm.Parameters["o_results"].Direction = ParameterDirection.Output;

        oComm.Parameters.Add("in_communicator", OracleDbType.Varchar2);
        oComm.Parameters["in_communicator"].Value = consumer;

        if (states.Count != 0)
        {
            oComm.Parameters.Add(new OracleParameter("in_states", OracleDbType.Varchar2)
            {
                CollectionType = OracleCollectionType.PLSQLAssociativeArray,
                Value = states.ToArray()
            });
        }
        else
        {
            oComm.Parameters.Add("in_state", OracleDbType.Varchar2);
            oComm.Parameters["in_state"].Value = null;
        }

        _oConn.Open();

        oDa.Fill(retVal);
        return retVal;
    }
    catch (Exception ex)
    {
        Console.WriteLine(ex);
        return null;
    }
    finally
    {
        if (_oConn.State != ConnectionState.Closed) _oConn.Close();
    }
}

I have tried placing colons in front of the parameters thinking the named parameters would do the trick with no luck.

I know i can call the code in SQLDeveloper like this:

variable o_results refcursor;
execute Apps.Base_communicator.get_requests_with_files(:o_results, in_communicator => 'MYCOMM', in_state => null);
print o_results;

So i know the overloads work, just not how to call them in c#

  • 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-06-18T15:57:36+00:00Added an answer on June 18, 2026 at 3:57 pm

    I found the solution was to add BindByName to the OracleCommand object. Doing this (and removing the colons) allowed it to bind to the variables by name. This let the overloads work as long as the names were different.

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

Sidebar

Related Questions

Setup: I have two trees of scripts that run on Oracle 11g - one
I have a stored procedure that takes no parameters, and it returns two fields.
I have complex procedures in oracle package with complex in/out parameters. I will show
I am new to Oracle, I have two tablespaces one for dev and one
I have a package named save_db_values I have two procedures named store_records and another
I have two stored procedures one is to insert a record to the table,
Currently, I have two Stored Procedures in SQL Server that handle retrieving a tree
I have two stored procedures that return a slightly different set of columns. I
I have two stored procedures. One (test_proc_outside) makes a call to a second one
I have a package with two variables that has constant values like below. person_name

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.