ORACLE存储过程中的动态游标
createorreplacepro_serch(tabnameinvarchar)isv_servicesnametabname.服务类型%type;--这个变量就是用...
create or replace pro_serch( tabname in varchar ) is v_servicesname tabname.服务类型%type; --这个变量就是用来存放所要取得的字段内容,但不知该如何定义 cursor curSort1 is select 服务类型 from tabname order by 编码; --此语句也不对提示找不到表名 begin .....
展开
1个回答
展开全部
declare cursor myCusor is select f_id from t_chip
where F_inlayBoxID IN(SELECT F_ID from t_inlayBox where F_inlayOutID=FID);
begin
open myCusor;
Loop
fetch myCusor into v_ChipID;
exit when myCusor%notfound;
select min(F_CurrentTime) into v_now from t_chipstatehistory
where (F_HistoryState='Confirm_Inlayln') and F_ChipID=v_ChipID;
update t_chip set f_State='Confirm_InlayIn',F_CompareTime=v_Now
v_ChipID;
insert into t_chip t_chipstatehistroy(f_chipid,f_historystate,
f_tableid,f_currenttime,f_tablename)
value(v_chipid,'Confirm_InlayIn',v_LogID,SYSDATE,'T_InlayOUT_Log')
end loop;
close myCusor;
where F_inlayBoxID IN(SELECT F_ID from t_inlayBox where F_inlayOutID=FID);
begin
open myCusor;
Loop
fetch myCusor into v_ChipID;
exit when myCusor%notfound;
select min(F_CurrentTime) into v_now from t_chipstatehistory
where (F_HistoryState='Confirm_Inlayln') and F_ChipID=v_ChipID;
update t_chip set f_State='Confirm_InlayIn',F_CompareTime=v_Now
v_ChipID;
insert into t_chip t_chipstatehistroy(f_chipid,f_historystate,
f_tableid,f_currenttime,f_tablename)
value(v_chipid,'Confirm_InlayIn',v_LogID,SYSDATE,'T_InlayOUT_Log')
end loop;
close myCusor;
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询