Just transferred from the Mysql/mssql database to Oracle, the update was unsuccessful when called in C #, and was later found to be a problem with incorrect format of the pass parameter.
The command in Oracle is preceded by a colon: callout in front of the parameter name. Both SQL Server and MySQL use @. See Http://www.codeproject.com/Questions/618582/ORA-00936-missing-expression
Public Static BOOLupdatenew (Entity.pw_user newuser) {Try{entity.pw_user TT=NewUser; StringBuilder SB=NewStringBuilder (); Sb. Append ("Update Pw_user Set"); Sb. Append ("Username=:username,"); Sb. Append ("password=:P Assword,"); Sb. Append ("Usergroupcode=:usergroupcode,"); Sb. Append ("Createtime=:createtime,"); Sb. Append ("Lastlogintime=:lastlogintime"); Sb. Append ("where Userid=:userid"); //the command in Oracle is preceded by a colon: callout in front of the parameter name. Both SQL Server and MySQL use @. //See-----http://www.codeproject.com/Questions/618582/ORA-00936-missing-expressionOracleCommand cmd =NewOracleCommand (); Cmd.commandtext=sb. ToString (); Cmd.commandtype=CommandType.Text; //The order of the following parameters must be the same as the order in which the arguments appear in the above statement. Otherwise, the update is unsuccessful. //the following userid parameter cannot appear before any one of the previous 5 parameters. Cmd. Parameters.Add (NewOracleParameter ("UserName", ORACLEDBTYPE.NVARCHAR2, $) {Value =TT. UserName}); Cmd. Parameters.Add (NewOracleParameter ("Password", ORACLEDBTYPE.VARCHAR2, $) {Value =TT. Password}); Cmd. Parameters.Add (NewOracleParameter ("Usergroupcode", ORACLEDBTYPE.VARCHAR2, $) {Value =TT. Usergroupcode}); Cmd. Parameters.Add (NewOracleParameter ("Createtime", ORACLEDBTYPE.VARCHAR2, $) {Value =TT. Createtime}); Cmd. Parameters.Add (NewOracleParameter ("Lastlogintime", ORACLEDBTYPE.VARCHAR2, $) {Value =TT. Lastlogintime}); Cmd. Parameters.Add (NewOracleParameter ("UserID", ORACLEDBTYPE.VARCHAR2, -) {Value =TT. UserID}); intval =dbhelper_oracle. ExecuteNonQuery (CMD); if(Val >0) { return true; } Else { return false; } } Catch { return false; } }
Hope to be useful to everyone.
C # update Oracle with parametric notation