create  package mypackage
as 
type mycursor is ref cursor;
end mypackage;
create or replace procedure holdTheCase(tid in number,cid in number,clid in number,cur out mypackage.mycursor)
as
userage at_turncase%rowtype;
sessionId number;
sessSerial number;
begin
      lock table  at_turncase in ROW   EXCLUSIVE   MODE ;
      update at_turncase set at_turncase.execstatus=2,at_turncase.clientid=clid where at_turncase.turnid=tid and at_turncase.caseid=cid;
      open cur for select * from at_turncase at where at.turnid=tid and at.caseid=cid;
      commit;
end;这是我存储过程与游标  请高手帮忙写一个 bat来。谢谢

解决方案 »

  1.   

    在bat中执行存储过程没问题
    关键你的输出游标,想做什么?
      

  2.   

    为了返回结果集 ,      我用的是oracle10g 能读到 游标与 存储过程的创建语句,  就是不发创建。
      

  3.   


    在批处理文件中写入以下命令(如 test.bat)sqlplus dxxt/dxxt@qzj @D:\1.sql在同目录的1.sql中内容如下exec test;
    exit;
      

  4.   

    不要老写错别字好吧 读起来很困难 也显得咱的母语水平太不过关了
    如果你只想执行存储过程 那就说明存储过程已经创建好了吧 你直接在sql文件中写
    exec test;
    exit;
    就行了啊,上边的代码你创建完不就已经在数据库中了吗?
    如果想创建存储过程,创建完是不会自动执行的,你是不是把创建和执行混淆了啊?
    执行完你上边的代码,你去数据库里看看这个存储过程有了吗,有的话,就说明创建成功了
      

  5.   

    sqlplus dxxt/dxxt@qzj @D:\1.sql
    存储过程写入1.sql中
      

  6.   

    解决了, 只需要在存放存储过程创建语句的sql里面,在存储过程的语句后面加上一个“/”,一切就OK了