public void updateweeks(string getdate)
{
string result = getdate.Substring(0,10);
OracleConnection con;
OracleCommand cmd;
con = new OracleConnection(strConnectionString);
cmd = con.CreateCommand();
cmd.CommandText = "UPDATE MO_T_WEEK_REPORT SET C_ISactIVE ='N' where TO_CHAR(TO_DATE(C_DATE,'DD/MM/YY hh24:mi:ss'),'DD/MM/YY')=TO_CHAR(TO_DATE('"+result+"','DD/MM/YY');";
con.Open();
cmd.ExecuteNonQuery();
con.Close();
}
在上面的代码中引发“ ORA-00933:SQL命令未正确结束”的异常。