问题
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 hh24:mi:ss'),'DD/MM/YY');";
con.Open();
cmd.ExecuteNonQuery();
con.Close();
}
In the above code to raise the Exception for "ORA-00933: SQL command not properly ended".
回答1:
Remove semi-colon at the end of the cmd.CommandText
, here:
M/YY');";
^
|
here
来源:https://stackoverflow.com/questions/58970954/ora-00933-sql-command-not-properly-ended