+ -
当前位置:首页 → 问答吧 → oracle for in loop 这样写 对吗?

oracle for in loop 这样写 对吗?

时间:2011-11-10

来源:互联网

for c in (select USER_ID,USER_NAME,EMAIL,STATUS into v_user_id,v_user_name,v_email,v_status
  from ierp_vote_attend where vote_id = V_VOTE_ID) 
  loop

作者: tinranqi   发布时间: 2011-11-10

加個 end loop ;

作者: a120255857   发布时间: 2011-11-10

FOR IN LOOP 中可不可以用select into

作者: tinranqi   发布时间: 2011-11-10

select语句不需要into,循环中可以直接用c.EMAIL,c.status等,如下:
SQL code
for c in (select USER_ID,USER_NAME,EMAIL,STATUS from ierp_vote_attend where vote_id = V_VOTE_ID)  
  loop 
if c.user_id is null then
--业务逻辑

end if;
end loop;

作者: tx2730   发布时间: 2011-11-10

引用 2 楼 tinranqi 的回复:
FOR IN LOOP 中可不可以用select into

对头

作者: rfb0204421   发布时间: 2011-11-10

谢谢!!谢谢!!!

作者: tinranqi   发布时间: 2011-11-10

引用 4 楼 rfb0204421 的回复:

引用 2 楼 tinranqi 的回复:
FOR IN LOOP 中可不可以用select into

对头
?是个疑问句

作者: tinranqi   发布时间: 2011-11-10