C#里这条SQL语句的意思

来源:百度知道 编辑:UC知道 时间:2024/05/16 10:08:13
string sqlCopy = "Insert Into ay_stl.slab_weight_stl_to_rm (last_weight,idd,RV_FLAG,STL_FLAG,RM_FLAG) " +
" select '" + double.Parse(this.txt_SumWeight.Text.Trim())*1000 + "',send_Id,'0','0','1' from slab_check where " +
"vehicle_No='" + this.txt_Vehicle.Text.Trim() + "' And Can_In Is Null And Is_In Is Null And Back_Flag Is Null And " +
"Refuse_Flag Is Null And Back_Scrap Is Null And Send_Factory='2005' And Rownum=1";

这是用C#后台拼出来的SQL语句,用的是Oracle数据库,是将select 'double.Parse(this.txt_SumWeight.Text.Trim())*1000 ',send_Id,'0','0','1' from slab_check where vehicle_No='this.txt_Vehicle.Text.Trim()' And Can_In Is Null And Is_In Is Null And Back_Flag Is Null And Refuse_Flag Is Null And Back_Scrap Is Null And Send_Factory='2005' And Rownum=1 数据插入到表ay_stl.slab_weight_stl_to_rm 中,对应的字段是last_weight,idd,RV_FLAG,STL_FLAG,RM_FLAG

说白了吧 就是向数据库ay_stl下的slab_weight_stl_to_rm 表里插入一条数据~

其实是两个语句第一个是执行插入数据,第二格式执行查询数据

是一条查询语句;查vehicle_No等于你在txt_SumWeight里输入的东西!!