Search code examples
c#system.data.oracleclient

ORA-00911: invalid character


I create two table in my oracle (11g) database like this:

    create table "test" ("id" int);
    create table test ("id" int);

Then in my C# program there is a problem :

    OracleConnection conn = new OracleConnection(-myConnectionString-);
    conn.Open();
    OracleCommand command = new OracleCommand("select * from test;", conn);
    var v = command.ExecuteReader(); 
    OracleCommand command = new OracleCommand("select * from \"test\";", conn);
    var v = command.ExecuteReader(); 

for both command.ExecuteReader() I have an "ORA-00911: invalid character" error.


Solution

  • Remove ; (semi-colon) from the end of SQL string