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来。谢谢
关键你的输出游标,想做什么?
在批处理文件中写入以下命令(如 test.bat)sqlplus dxxt/dxxt@qzj @D:\1.sql在同目录的1.sql中内容如下exec test;
exit;
如果你只想执行存储过程 那就说明存储过程已经创建好了吧 你直接在sql文件中写
exec test;
exit;
就行了啊,上边的代码你创建完不就已经在数据库中了吗?
如果想创建存储过程,创建完是不会自动执行的,你是不是把创建和执行混淆了啊?
执行完你上边的代码,你去数据库里看看这个存储过程有了吗,有的话,就说明创建成功了
存储过程写入1.sql中