본문 바로가기

PL3

Day 61. [Spring, PL/SQL] Spring, ROLLBACK, SAVEPOINT, 함수 선언 와 드디어 60일 돌파 Spring을 깔아보았지요 후후후 일반 이클립스랑 다른 건 크게 없어보이는데 이야.... maven 프로젝트를 만들고 pom.xml을 봤는데 이거만 들고 와서 넣었는데 호올리... ROLLBACK / SAVEPOINT DELETE FROM TBL_MEMBER WHERE ID = 'aaaa'; SAVEPOINT S1; DELETE FROM TBL_MEMBER WHERE ID = 'amanna'; SAVEPOINT S2; ROLLBACK S1; PROCDURE CREATE OR REPLACE PROCEDURE QUIT_PROC (P_ID TBL_MEMBER.ID%TYPE) IS BEGIN UPDATE TBL_BOARD SET WRITER = NULL WHERE WRITER = P_ID.. 2022. 4. 1.
Day 60. [PL/SQL] CASE, WHILE, FOR, LOOP CASE 문 SET SERVEROUTPUT ON; DECLARE VN_SALARY NUMBER := 0; VN_DEPARTMENT_ID NUMBER := 0; BEGIN VN_DEPARTMENT_ID := ROUND(DBMS_RANDOM.VALUE (10, 120), -1); SELECT SALARY INTO VN_SALARY FROM EMPLOYEES WHERE DEPARTMENT_ID = VN_DEPARTMENT_ID AND ROWNUM = 1; DBMS_OUTPUT.PUT_LINE(VN_SALARY); DBMS_OUTPUT.PUT_LINE(VN_DEPARTMENT_ID); CASE WHEN VN_SALARY BETWEEN 1 AND 3000 THEN DBMS_OUTPUT.PUT_LINE('낮음');.. 2022. 3. 31.
Day 58. [PL/SQL] 익명 블록, 제어문 익명 블록 사용 방법 SET SERVEROUTPUT ON; SET TIMING ON; DECLARE vi_num INTEGER; BEGIN vi_num := 100.5; DBMS_OUTPUT.PUT_LINE(vi_num); END; / DECLARE A INTEGER := 2**2*3**2; BEGIN DBMS_OUTPUT.PUT_LINE('A = '||A); END; / DECLARE V_NAME STUDENT.NAME%TYPE; V_DEPTNO STUDENT.DEPTNO%TYPE; BEGIN SELECT NAME, DEPTNO INTO V_NAME, V_DEPTNO FROM STUDENT WHERE STUDNO = 10101; DBMS_OUTPUT.PUT_LINE(V_NAME || '-' || V_D.. 2022. 3. 29.