SQLLDR 手动打命令可以,通过程序不行,救命,谢谢!
大家好:
我用sqlloader导数据到Oracle,配置文件什么的都是好的,手动进入cmd,打了下面这个命令:
“sqlldr userid=aa/bb control=control.ctl”都是导入成功,可是我用c#写以下code:
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.FileName = "cmd.exe";
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.CreateNoWindow = true;
// string strOutput = null;
try
{
p.Start();
p.StandardInput.WriteLine(@"cd\");
p.StandardInput.WriteLine(@"sqlldr userid=aa/bb control=control.ctl");
p.StandardInput.WriteLine("exit");
// strOutput = p.StandardOutput.ReadToEnd();
p.WaitForExit();
p.Close();
UpdateEventArgs e = new UpdateEventArgs(true);
OnUpdateSuccess(e);
}
catch
{
p.Close();
throw;
}
程序执行没问题,不报错,可是我看strOutput时发现,sqlldr没能导入数据,“达到提交点,逻辑记录计数49”这些语句没有出现,还有补充一点,一样的程序在我本机上是好的,可是放在服务器上就不行了,本机是xp,服务器是windows2003,请大家帮我看看是什么原因,(个人认为不是程序的原因,而是权限的问题,不知道对不对)先谢谢了!