Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the ultimate-member domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /ledcorps/www/wp/wp-includes/functions.php on line 6114 4.1 INSERT – 대나무숲

4.1 INSERT

출처 http://www.gurubee.net/lecture/1051

PL/SQL에서의 INSERT 문은 SQL과 비슷하다.

INSERT 예제

 
-- 사원 등록  프로시저 예제 
SQL> CREATE OR REPLACE PROCEDURE Insert_Test
        ( v_empno  IN emp.empno%TYPE,
          v_ename  IN emp.ename%TYPE,
          v_deptno IN emp.deptno%TYPE )

     IS

     BEGIN

          DBMS_OUTPUT.ENABLE;
    
          INSERT INTO emp(empno, ename, hiredate, deptno)
          VALUES(v_empno, v_ename, sysdate, v_deptno);

          COMMIT;
		  
          DBMS_OUTPUT.PUT_LINE( '사원번호 : ' || v_empno );
          DBMS_OUTPUT.PUT_LINE( '사원이름 : ' || v_ename );
          DBMS_OUTPUT.PUT_LINE( '사원부서 : ' || v_deptno );
          DBMS_OUTPUT.PUT_LINE( '데이터 입력 성공 ' );

     END ;
    /           

-- DBMS_OUTPUT.PUT_LINE을 출력하기 위해 사용 
SQL> SET SERVEROUTPUT ON ;  

-- 실행 결과
SQL> EXECUTE Insert_Test(1000, 'brave', 20);

사원번호 : 1000
사원이름 : brave
사원부서 : 20
데이터 입력 성공

PL/SQL 처리가 정상적으로 완료되었습니다.

    

답글 남기기 0

Your email address will not be published. Required fields are marked *