各位大神,我想向oracle插入大量数据(300W条吧,读入的text文档)我是这么实现的,可是sql语句总是提示无效字符,可是我在sqlplus中可以运行的,下面是代码
private string getsql()
{
string path = @"e:\ip.txt";
StreamReader sr = new StreamReader(path);
sb = new StringBuilder();
string ip = sr.ReadLine();
while (ip != null)
{
sb.Append("INSERT /*+Append*/ INTO TB_IP(IP) VALUES('" + ip + "');\n");
ip = sr.ReadLine();
}
iptemp = sb.ToString();
return iptemp;
}
//这是获得批量sql语句的方法,调用的时候
odbCommand.CommandText = iptemp;
odbCommand.ExecuteNonQuery();