///ShellOSQL.cs
 
using System;
using System.Diagnostics;
namespace ProInstall
{
 public class ShellOSQL
 {
  static  void  Main()
  {
   ProcessStartInfo  Info  =  new  System.Diagnostics.ProcessStartInfo();
   Info.FileName="osql.exe";
   //Info.Arguments="Ocean.SQL";
   Info.Arguments = string.Format(" -S{0} -U{1} -P{2} -i{3}", "Ocean","sa","sa","c:\\Ocean.SQL");
            Info.WorkingDirectory="C:\\Documents and Settings\\Ocean\\My Documents\\Visual Studio Projects\\ProInstall\\bin\\Debug";
  }
 }
 }
 
///Ocean.SQL
update pubs..titles set type='Ocean' where title_id='BU1032'
 
///osql.exe
默认目录为:
C:\Program Files\Microsoft SQL Server\80\Tools\Binn
把osql.exe复制到C:\\Documents and Settings\\Ocean\\My Documents\\Visual Studio Projects\\ProInstall\\bin\\Debug目录下.
上面的程序是我写的对C#代码,使用到了OSQL.EXE,现在我要实现的是对ORACLE同样的操作,问题是不知道ORACLE有没有OSQL.EXE的功能??在线等......

解决方案 »

  1.   

    sqlplus.exe。命令行参数与osql不一样。osql -Sservername -Uusername -Ppassword -ifilename转成sqlplus是sqlplus username/password@servername @filename。并且脚本中最后一行必须要有exit,每行脚本要末尾要有分号。
      

  2.   

    如果离开Orale环境要运行
    执行Sqlplus需要如何配置?
    (我的操作系统是Windows XP)
    除了Copy SqlPlus.exe到本地,还需要什么样的配置??
      

  3.   

    至少要安装oracle客户端。网上有免安装版的9i客户端,很好用。
      

  4.   

    至少要安装oracle客户端。网上有免安装版的9i客户端,很好用。非常感谢你。。我没有找到?9i客户端,是不是很大??最好有不超过20M的客户端还可以。
    太大了就不行了,关键还要支持SQLPLUS.exe
      

  5.   

    http://community.csdn.net/Expert/topic/4023/4023237.xml?temp=.8502924
    其中wangybyangxr(王永斌) 介绍的http://youngcow.net站点上有免安装版的下载。压缩文件是11M,解压后是36M。还可以再裁剪。