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

31 lines
692 B
Markdown

### For문
```sql
FOR idx IN 1..11 LOOP
v_workList := v_workList ||';'|| idx ||'$'||''||'$'||''||'$'||''||'$'||''||'$'||''||'$'||''||'$'||'';
END LOOP;
```
### For ~ IN ()
```sql
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;
```