Search code examples
c#.netsqloracle-databaseora-01722

Oracle Invalid number error from C#


I run the below code in my C# .Net application, but I keep getting error ORA-01722: invalid number. When running the same SQL directly in PL/SQL Developer it does exactly what I ask it to without complaining.

What could be causing this?

OracleCommand command = connection.CreateCommand();
command.CommandType = CommandType.Text;
command.CommandText = "insert into my_table ( select i.*, null from my_view i where i.usr_id is not null )";
command.ExecuteNonQuery();

Note: I am using Oracle.DataAccess.Client


Solution

  • I found the problem. One of the number columns in the view used a comma (,) as a decimal seperator, while the table expected a point (.).

    Thanks for the help people. :)