I am attempting to create a simple table in Direct mode. I've verified that the connection is open but when I attempt:
OracleCommand cmd = new OracleCommand(sqlOra, connection);
cmd.ExecuteNonQuery();
It fails with the ORA-00922 message. The sqlOra variable seems to be valid. I can paste the text directly into SQL Plus and SQL Developer and it works.
Oracle version = 12c
dotConnect version = 9.1.97
Any help is appreciated.
ORA-00922 Missing or Invalid Option when creating a table
Re: ORA-00922 Missing or Invalid Option when creating a table
This code works in our environment:
Please tell us how we should modify this sample to reproduce the error you have encountered.
Code: Select all
var monitor = new OracleMonitor() { IsActive = true };
using (var connection = new OracleConnection("server=orcl12c;uid=****;pwd=****;")) {
connection.Open();
string sqlOra = "CREATE TABLE T1 (ID NUMBER PRIMARY KEY, SOMEDATA VARCHAR2(50))";
OracleCommand cmd = new OracleCommand(sqlOra, connection);
cmd.ExecuteNonQuery();
}
Re: ORA-00922 Missing or Invalid Option when creating a table
Thank you for the reply.
Your sample helped me find my idiotic mistake. I left a semicolon at the end of the sql statement within the string. I don't know why or when I added it but I certainly overlooked it thinking it was a bigger issue....
Your sample helped me find my idiotic mistake. I left a semicolon at the end of the sql statement within the string. I don't know why or when I added it but I certainly overlooked it thinking it was a bigger issue....