日期:2014-05-16 浏览次数:21075 次
begin
for i in (select a.rowid,b.name from tba a,tbb b where a.id=b.id) loop
update tba set name=i.name where rowid=i.rowid;
end loop;
end;
string connection = ConfigurationManager.AppSettings["conn"].ToString();
System.Data.OracleClient.OracleConnection cnn = new OracleConnection(connection);
string filepath = "脚本.txt";
System.IO.StreamReader sr = new System.IO.StreamReader(filepath);
string sqlstr = sr.ReadToEnd();
sr.Close();
System.Data.OracleClient.OracleCommand Command = new System.Data.OracleClient.OracleCommand(sqlstr, cnn);
Command.Connection.Open();
Command.ExecuteNonQuery();
Command.Connection.Close();
string filepath = "D:\\脚本.txt";
using (StreamReader sr = new StreamReader(filepath, System.Text.Encoding.GetEncoding("GB2312")))
{
string sqlstr = sr.ReadToEnd();
Console.ReadLine();
}