请教一个关于用户自定义函数update的问题
chhx0 2004-04-09 03:49:31 CREATE FUNCTION uf_ifjumpout (
@as_ssnno char(18),
@as_modeno char(10),
@ai_pass integer,
@as_repperno char(10))
RETURNS integer AS
BEGIN
declare @li_jumpout integer ,
@li_sqlerr integer,
@li_ret integer,
@adec_planid decimal(18),
@ls_procno char(10),
@ls_orderno char(18),
@ldt_todaytime datetime,
@ldt_jumpdate datetime
if @ai_pass = 0
begin
select @adec_planid = (select max(plan_id) from pp_plan_mstr where plan_planqty > plan_inqty)
if isnull(@adec_planid, 0) = 0
begin
//此update语句无法通过,不知道如何处理
update pp_plan_mstr set plan_inqty = plan_inqty + 1 where plan_id = @adec_planid;
end
end return @li_sqlerr
END