-
Notifications
You must be signed in to change notification settings - Fork 1
/
throws-00911.cs
33 lines (24 loc) · 1006 Bytes
/
throws-00911.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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;
}
}