I'm new to using ORACLE with entity framework 5. Trying a simple update statement which won't work and I m getting an error "ORA-00936: missing expression"
Entities context = new Entities();
var Description="UpdateTesting";
var Id = "1";
string UpdateSqlString = @"Update SOURCE Set DESCRIPTION={0} where SOURCEID={1}";
int RowsUpdated = context.Database.ExecuteSqlCommand(UpdateSqlString, Description, Id);
context.SaveChanges();
I have also tried the following but still getting the same error
Entities context = new Entities();
var Description = "UpdateTesting";
var Id = "1";
var sql = @"Update SOURCE Set DESCRIPTION = @DESCRIPTION WHERE SOURCEID = @Id";
int RowsUpdated = context.Database.ExecuteSqlCommand(sql, new OracleParameter("DESCRIPTION", Description),
new OracleParameter("Id", Id));
context.SaveChanges();
I have now tried with the following syntax but nothing happens after the ExecuteSqlCommand and the application probably goes in some not-ending loop
var Description="UpdateTesting";
var SOURCEId = "1";
var sql = "Update SOURCE SET DESCRIPTION = :Description WHERE SOURCEID = :SOURCEId";
int RowsUpdated=context.Database.ExecuteSqlCommand(
sql,
new OracleParameter(":Description", Description),
new OracleParameter(":SOURCEId", SOURCEId));
I can provide SQL Create table script If that would help resolve this.
Any ideas? thanks