I do the same thing with Orace driver (MSFT) and it work perfectly !
Sample code
var command = model.Connection.CreateCommand();
command.Connection.Open();
var tns = model.Connection.BeginTransaction();
command.Connection = model.Connection;
command.CommandType = CommandType.Text;
command.CommandText = @"ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS';";
command.Transaction = tns;
command.Parameters.Clear();
command.ExecuteNonQuery();
The query syntax is not valid., near identifier 'SESSION
-
- Devart Team
- Posts: 1710
- Joined: Thu 03 Dec 2009 10:48
Please remove the semicolon from the CommandText, this will be
dotConnect for Oracle doesn't parse OracleCommand.CommandText, thus the command with a semicolon is interpreted as a PL/SQL block and hence causes an error. If you do want to use a PL/SQL block, please use the OracleScript class.
Code: Select all
command.CommandText = @"ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS'";