Search notes:

ODP.NET / ORA-00911

An SQL statement whose text contains the Unicode character \U00A0 = No-Break Space (NBSP) causes an ORA-00911: invalid character error when used in a .NET application that used ODP.NET.
create table ora_00911_test (
   col_1  number,
   col_2  number
);
Github repository .NET-API, path: /Oracle/ORA-00911/create-table.sql
using System;
using Oracle.ManagedDataAccess.Client;

static class ORA_00911 {

   static void execStatement(OracleConnection conn, string stmt) {
   try {

        OracleCommand cmd = (Oracle.ManagedDataAccess.Client.OracleCommand) conn.CreateCommand();
        cmd.CommandText   = stmt;
        cmd.ExecuteNonQuery();
   }
   catch (Exception ex) {
        Console.WriteLine($"Statement {stmt} threw {ex.Message}");
   }
   }


   static int Main(string[] args) {

        OracleConnection conn = new Oracle.ManagedDataAccess.Client.OracleConnection("Data Source=ora19;User Id=rene;Password=rene");
        conn.Open();
        System.Data.Common.DbTransaction trx = conn.BeginTransaction();

        execStatement(conn, "insert into ora_00911_test(col_1, col_2) values (1, 1)");
        execStatement(conn, "insert into ora_00911_test(col_1, col_2) values (2,\u00a02)"); // <<< Note the 'No-Break Space (NBSP)' character (=0x0a).

        trx.Commit();
        conn.Dispose();

        return 0;
   }
}
Github repository .NET-API, path: /Oracle/ORA-00911/throws-00911.cs

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1738303430, '3.144.242.235', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/Oracle/errors/ORA-00911_invalid-character/dot-net(76): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78