生成存储过程:
打开Query Analyzer,在查询面板里编写你的存储过程代码:
create procedure your_procedure_name
as
......
(这里是你的存储过程的执行代码,根据实际情况编写.)
在PB里调用:
String s_rk=''
DECLARE rk_proc PROCEDURE FOR proc_yprk @shczybm=:str_shczybm;
EXECUTE rk_proc;
FETCH rk_proc INTO :s_rk;
CLOSE rk_proc;
IF SQLCA.SQLCODE<0 then
rollback using sqlca;
Messagebox("失败","药品入库审核失败,请重试! ")
return 1
else
//.........
end if
Example 1 This statement declares the Sybase SQL Server procedure Emp_proc for the database specified in the default transaction object. It references the Emp_name_var and Emp_sal_var variables, which must be set to appropriate values before you execute the EXECUTE Emp_proc command: