[ Oracle - Procedure 문법_WHILE문 ]

 

 

WHILE문

1. 형식

WHILE condition LOOP

 

statement;

 

...

 

END LOOP;

  

2. 예제

  ex) ...

          v_ord_id s_item.ord_id%TYPE := 101;

          v_counter NUMBER(2) := 1;

        BEGIN

          ...

        WHILE v-counter <= 10 LOOP

            INSERT INTO s_item (ord_id, item_id)

            VALUES (v_ord_id, v_counter);

                          v_counter := v_counter + 1;

        END LOOP;

          ...

 

'(DB) Oracle > PL.SQL' 카테고리의 다른 글

Oracle - Procedure 문법_Cursor_01  (0) 2017.01.21
Oracle - Procedure 문법_DBMS_OUTPUT  (0) 2017.01.21
Oracle - Procedure 문법_LOOP문  (0) 2017.01.21
Oracle - Procedure 문법_IF문  (0) 2017.01.21
Oracle - Procedure 문법_FOR_LOOP문  (0) 2017.01.21
Posted by 농부지기
,