url

http://bbs.csdn.net/topics/330187188

http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.help.ase_15.0.commands/html/commands/commands66.htm

dw_1.insertrow(0)

DECLARE proc PROCEDURE FOR bigbatch using sqlca;
//OPEN proc;
EXECUTE proc;


//Close proc;
dw_1.accepttext()

int li_rtn
li_rtn = dw_1.update(false,false)
if  li_rtn = 1 then
 messagebox('update sucess','use update successful')
 dw_1.resetupdate()
else
 
 messagebox('update error',sqlca.sqlerrtext)
 return
end if

 drop procedure bigbatch
go
create procedure bigbatch
as
begin transaction
lock table T1 in share mode wait 5
if @@error = 12207 
begin
    /*
    ** Allow SA to run without the table lock
    ** Other users get an error message
    */
    if (proc_role("sa_role") = 0)
    begin
    print "You cannot run this procedure at
        this time, please try again later"
    rollback transaction
    return 100
    end
else
    begin
    print "Couldn't obtain table lock,proceeding with default locking."
    end
end
/* more SQL here */
--commit transaction

原文地址:https://www.cnblogs.com/v888/p/3114578.html