¤ë‌¼´ SQLê³¼ PL/SQL‌„ ë‹¤ë£¨ë” ê¸°ˆ 

  • View
    146

  • Download
    8

Embed Size (px)

Text of ¤ë‌¼´ SQLê³¼ PL/SQL‌„...

  1. 1. The Technique of Java Programming
  2. 2. !!!!
  3. 3. SQL PL/SQL : , ! : - SQL&PL/SQL - Head First
  4. 4. TABLE . PL/SQL 14
  5. 5. 01 TABLE 02 TABLE 03
  6. 6. 01 ? MSSQL , , SELECT MSSQL SELECT
  7. 7. 02 Global Temporary Table, GTT GLOBAL GTT GTT
  8. 8. 02 GTT GTT COMMIT CREATE GLOBAL TEMPORARY TABLE ( 1 , ) [ ON COMMIT DELETE ROWS ] ; ON COMMIT DELETE ROWS COMMIT ,
  9. 9. 02 GTT GTT CREATE GLOBAL TEMPORARY TABLE ( 1 , ) ON COMMIT PRESERVE ROWS; ON COMMIT PRESERVE ROWS COMMIT
  10. 10. 02 GTT GTT GTT GTT UPDATE, DELETE, MERGE GTT GTT
  11. 11. 03 TABLE TABLE TABLE FROM TABLE VARRAY
  12. 12. 03 TABLE CREATE OR REPLACE TYPE ch14_num_nt IS TABLE OF NUMBER; ch14_num_nt CREATE OR REPLACE FUNCTION fn_ch14_table1 ( p_n NUMBER ) RETURN ch14_num_nt -- IS -- ( ) vnt_return ch14_num_nt := ch14_num_nt(); BEGIN -- 1 p_n . FOR i IN 1..p_n LOOP vnt_return.EXTEND; vnt_return(i) := i ; END LOOP; RETURN vnt_return; -- . END;
  13. 13. 03 TABLE fn_ch14_table1 SELECT fn_ch14_table1 (10) FROM DUAL; FN_CH14_TABLE1(10) -------------------------------------------------------- ORA_USER.CH14_NUM_NT(1,2,3,4,5,6,7,8,9,10) TABLE SELECT * FROM TABLE(fn_ch14_table1 (10)); COLUMN_VALUE -------------------- 1 2
  14. 14. 03 TABLE , PIPELINED PIPE ROW PIPE ROW( );
  15. 15. 03 TABLE CREATE OR REPLACE FUNCTION ( ) RETURN PIPELINED IS BEGIN LOOP PIPE ROW ( ); END LOOP; RETURN; END;
  16. 16. 04 DECODE CASE WITH PIVOT SELECT FROM ( __SELECT ) PIVOT ( () FOR [ ( ] _ [, _2, . ) ] IN ( ___ ) );
  17. 17. 04 UNION ALL UNPIVOT PIVOT DBMS_SQL