ORA-00933: SQL command not properly ended -

和自甴很熟 提交于 2021-02-17 05:47:46

问题


 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!