Obsidian/Recognition/Programing/Oracle/Loop문.md

692 B

For문

FOR idx IN 1..11 LOOP

	v_workList := v_workList ||';'|| idx ||'$'||''||'$'||''||'$'||''||'$'||''||'$'||''||'$'||''||'$'||'';
          
END LOOP;

For ~ IN ()

FOR wrk IN ( 
        select a.seq,
               a.itnbr,
               a.itdsc,
               a.sprc,
               a.sqty,
               a.samt,
               a.bigo,
               a.sts
        from mobile_csorder_worklist a
        where a.sjpno = ar_sjpno
        and a.saupj = ar_saupj
    )    
    LOOP
    
        v_workList := v_workList ||';'|| wrk.seq||'$'||wrk.itnbr||'$'||wrk.itdsc||'$'||wrk.sprc||'$'||wrk.sqty||'$'||wrk.samt||'$'||wrk.bigo||'$'||wrk.sts;
    
end loop;