新手提问:最简单的存储过程问题!
存储过程
create or replace procedure UpdateDivCell
(intFstRowId in Integer,
intBudgetId in Integer,
gSetid In Integer,
gYear In Integer,
spdivrowid Out Number
)
Is
SQLText varchar2(2048);
begin
SQLText:=' SELECT a.DivRowid, b.name bname, b.Code BCode FROM DivPay a LEFT JOIN temp_Budgetsection b ON a.year = b.year AND a.bid = b.bid';
If intFstRowId <> 0 Then
SQLText:=SQLText|| 'and a.BudgetId = '||0|| 'and a.FstRowId = '||intFstRowId;
Else
SQLText:=SQLText|| 'and a.BudgetId = '||0|| 'and a.FstRowId= '||intBudgetId;
End If;
SQLText:='begin '||SQLText ||';end;';
execute immediate SQLText;
end UpdateDivCell;
我想用spdivrowid 这个值返回查询结果里面的divrowid字段值,这个该怎么修改?
这是小弟第一次写存储过程,感激了!