title: ORA-01400 can't insert null value... but I am NOT inserting null value!
body: <p>I am trying to insert data in an Oracle table by using ODP.NET from a C# application, but I am getting an <em>ORA-01400 can't insert null value</em> error for a column in which I am NOT inserting a null value.</p>
  
  <p>This is the stripped down version of the parametrized SQL command I am trying to execute. It is wrapped in an <code>OracleCommand</code> and executed with an invokation of <code>ExecuteNonQuery</code>:</p>
  
  <pre><code>declare c int; 
  begin
     select count(*) into c from "Entradas" where "Id" = :Id and nvl("AppId", 0) = nvl(:AppId, 0);
     if c&gt;0 then
         update "Entradas" set
           /*...a bunch of columns...*/,
           "VisitaLaboral" = :VisitaLaboral,
           /*...some more columns...*/
           where "Id" = :Id and nvl("AppId",0) = nvl(:AppId, 0); 
     else
         insert into "Entradas" (
           /*... a bunch of columns...*/,
           "VisitaLaboral",
           /*...some more columns...*/
           ) values (
           /*...a bunch of values...*/,
           :VisitaLaboral,
           /*...some more values...*/
         );
     end if;
  end;
  </code></pre>
  
  <p>The row does not exist previously so it is the <code>insert</code> part of the command the one that is executed. Of course I have verified that all the column names and column value parameters are properly placed in the SQL text.</p>
  
  <p>The problem is in the <code>VisitaLaboral</code> column. It is of type NUMBER(1,0), it does not accept NULLs, and I am trying to insert a value of 0. This is what Visual Studio displays about the associated <code>OracleParameter</code> immediately before the command execution:</p>
  
  <p><img src="https://i.stack.imgur.com/Ry1IA.png" alt="enter image description here"></p>
  
  <p>However if I execute the command directly in Application Express (providing the values directly in the command text), it works fine and the row is inserted.</p>
  
  <p>So, what is happening here? Is there a bug in the ODP.NET library, or am I doing something wrong?</p>
  
  <p>Additional information:</p>
  
  <ul>
  <li>Database is Oracle 10g Express Release 10.2.0.1.0</li>
  <li>Oracle.DataAccess.dll version is 4.112.1.2</li>
  <li>Using Visual Studio 2010, targeting .NET framework 4.0</li>
  </ul>
  
  <p>Thank you in advance!</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>Everything works fine if I use the (deprecated) <code>System.Data.OracleClient</code> classes instead of ODP.NET.</p>
  
  <p>WTF, Oracle? No, really, WTF?</p>