select newbosid('8E088616') into FNewID1 from dual;
update T_IM_PurInWarehsEntry set fparentid= FNewID(参数),fid=FNewID1(参数) where fparentid=foldid(参数);
在oracle中写一个循环,讲newbosid('8E088616')随机数插入都FNeWID1
答案:2 悬赏:10
解决时间 2021-12-22 02:11
- 提问者网友:梧桐不渝
- 2021-12-21 18:18
最佳答案
- 二级知识专家网友:滚刀废物浮浪人
- 2021-12-21 19:35
麻烦你称述清楚一点, ORACLE是没有newbosid这样的函数的,
循环这个
for c in (select newbosid('8E088616') as FNewID1 from dual) loop
update T_IM_PurInWarehsEntry set fparentid= FNewID(参数),fid=c.FNewID1 where fparentid=foldid(参数);
end loop;
is this the reslut what you want?
循环这个
for c in (select newbosid('8E088616') as FNewID1 from dual) loop
update T_IM_PurInWarehsEntry set fparentid= FNewID(参数),fid=c.FNewID1 where fparentid=foldid(参数);
end loop;
is this the reslut what you want?
全部回答
- 1楼网友:蜜罐小熊
- 2021-12-21 20:39
oracle随机函数可以用以下方式获取;
select dbms_random.random from dual;
你的语句可以直接修改成:
select newbosid(foldid),newbosid(foldid)
into fnewid,fnewid1
from dual;
update t_im_purinwarehsentry
set fparentid= fnewid(参数),fid=fnewid1(参数)
where fparentid=foldid(参数);
如果你是在某个存储过程中,则可以简化成:
update t_im_purinwarehsentry
set fparentid= newbosid(foldid),fid=newbosid(foldid)
where fparentid=foldid;
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯