Associative array parameter from c# - handling Null element values — oracle-tech

    Forum Stats

  • 3,708,688 Users
  • 2,241,109 Discussions
  • 7,840,539 Comments

Discussions

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Associative array parameter from c# - handling Null element values

987862987862 Posts: 14
edited September 2020 in ODP.NET

I am sure others have run into it but I could not manage to locate an answer. The answers on the web seem to relate to NULL array rather than null values inside the array elements.

In this simplified example - let's say I have defined the following types in my Package...

     TYPE t_NUMBER IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;

    TYPE t_VARCHAR IS TABLE OF VARCHAR2(30) INDEX BY BINARY_INTEGER;

I am providing an input Associative Arrays of types t_NUMBER and  t_VARCHAR as parameters from my c# code to my stored procedure with Oracle.ManagedDataAccess.dll. Some of my elements in the arrray(s) supplied as value for the parameters need to be null as I am representing rows in the table with the arrays. What value should the null elements have?DbNull.Value ? Something else?

Many thanks!

Answers

  • 987862987862 Posts: 14
    edited September 2020

    Any advice at all?

  • Alex Keh-OracleAlex Keh-Oracle Posts: 2,720 Employee
    edited September 2020

    I use DbNull.Value.

    987862
  • 987862987862 Posts: 14
    edited September 2020

    Thank you! I will go that route, I have been using DbNull.Value for null all along and but being new to Associative Arrays, I got waylaid in misreading some of the posts I saw about concerns with nulls and associative arrays. Looks like I should just go back to that.

    Many thanks!

Sign In or Register to comment.