Home > Database > Mysql Tutorial > body text

游标的使用

WBOY
Release: 2016-06-07 16:10:25
Original
1437 people have browsed it

定义游标: cursor calenderStatus_cur is select * from ut_calenderStatus ; vr_calenderStatus ut_calenderStatus % rowtype; 打开游标,提取游标中的数据到游标行中: open calenderStatus_cur; loop fetch calenderStatus_cur into vr_calenderStatus;

定义游标:

    cursor calenderStatus_cur 
    is
    select * from ut_calenderStatus ;
    vr_calenderStatus      ut_calenderStatus % rowtype;
Copy after login


打开游标,提取游标中的数据到游标行中:

    open calenderStatus_cur;
        loop
          fetch calenderStatus_cur into vr_calenderStatus;
          exit when calenderStatus_cur % notfound;
          up_日历_产品开放期设置(pi_serviceid,pi_opid,vr_calenderStatus.Calenderstatus,vr_calenderStatus.Fundcode,'0',pi_rq,pi_begin,pi_end,
                                       vr_calenderStatus.m,vr_calenderStatus.n,vr_calenderStatus.Prolong,po_returnmsg ,po_returncode); 
          if po_returncode <> &#39;0000&#39; then
           rollback;
           return;
          end if;          
        end loop;
    close calenderStatus_cur;
Copy after login


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template