목록Programming/SQL (2)
by Nathan
MERGE INTO 구문
12345678910111213141516171819202122232425262728MERGE INTO TB_ABCDE a USING ( SELECT #{aaa} AS AAA , #{bbb} AS BBB FROM DUAL ) indata ON ( a.AAA = indata.AAA AND a.BBB = indata.BBB ) WHEN NOT MATCHED THEN INSERT ( AAA , BBB , CCC , DDD , EEE , REGDATE , MODDATE ) VALUES ( #{aaa} , #{bbb} , #{ccc} , #{ddd} , #{eee} , TO_CHAR(SYSTIMESTAMP,'yyyymmddhh24miss') , TO_CHAR(SYSTIMESTAMP,'yyyymmddhh24miss..
Programming/SQL
2018. 8. 20. 10:13
Oracle Create Table
12345678CREATE TABLE ABC_TABLE( AAA VARCHAR2(10) NOT NULL, BBB NUMBER(2,0) NOT NULL, HTML CLOB NOT NULL, REGDATE VARCHAR2(14) DEFAULT TO_CHAR(SYSDATE, 'YYYYMMDDHH24MISS'), MODDATE VARCHAR2(14) DEFAULT TO_CHAR(SYSDATE, 'YYYYMMDDHH24MISS'), CONSTRAINT PK_ABC_TABLE PRIMARY KEY(AAA, BBB));Colored by Color Scriptercs
Programming/SQL
2018. 8. 13. 10:21