[ Oracle - Procedure 문법_IF문 ]

 

1. 기본 문법

2. if문에 in 사용법

3. if문에 exists 사용법

4. if문에 between 사용법

1.문법 (기본식)

    IF condition THEN

        statement;

   [ELSIF condition THEN

        statement;]

   [ELSE

       statement;]

    END IF;

2. 문법(in)

     If 문의 비교 부분에 IN 을 넣을 수 있음

     예]

     if   (x_bill_gubun2   IN   (1,2,3,6)) then x_sum:=x_sum+x_bill_amt;

3. 문법(Exists)

    if exists(select * from inserted where J_NAME='ABC') begin

         ....

    end

    * count 를 할 필요 없이.. 그냥 * 로 하면 됨..

4. IF 문을 from ~ to 로 하는 경우

    IF iRtnMonth between 1 and 11 THEN

       .....

    END IF

 

 

 

Posted by 농부지기
,