본문 바로가기

닷컴's_열공/Database

PL/SQL 블록 예제

 

<!--

    테스트 PL/SQL

    -->

    <insert id="insertTest">

        DECLARE

            seqVal NUMBER;

        BEGIN

            SELECT

                SEQ

            INTO

                seqVal

            FROM

                테이블

            WHERE

                

                

            IF seqVal IS NOT NULL THEN

                MERGE INTO 테이블2

                USING DUAL

                ON(

                    SEQ    = seqVal    

                )

                WHEN NOT MATCHED THEN

                 INSERT

                 (

                     

                 )

                 VALUES

                 (

                     

                 );

            END IF;

        END;

    </insert>