'DB'에 해당되는 글 2건

  1. 2013.12.12 SEQUENCE
  2. 2013.10.20 using DAYS from DB2

SEQUENCE

|



CREATE SEQUENCE emp_seq START WITH 1 INCREMENT BY 1 MAXVALUE 100000;


INSERT INTO emp(empno, ename, hiredate ) VALUES

(emp_seq.NEXTVAL, 'julia' , sysdate); 


SELECT emp_seq.CURRVAL FROM DUAL;


SELECT emp_seq.NEXTVAL FROM DUAL; 



ALTER SEQUENCE emp_seq INCREMENT BY 2 CYCLE;



DROP SEQUENCE emp_seq; 

'DB' 카테고리의 다른 글

SEQUENCE  (0) 2013.12.12
using DAYS from DB2  (0) 2013.10.20
Trackback 0 And Comment 0

using DAYS from DB2

|

SELECT 

DAY('2013-03-03') - DAYS(TO_CHAR(TO_DATE(CHAR(HEX(CURRENT DATE)), 'YYYY-MM-DD'), 'YYYY-MM-DD'))

from sysibm.sysdummy1  


---------------------------------------------------------------------------------------------------------



'DB' 카테고리의 다른 글

SEQUENCE  (0) 2013.12.12
using DAYS from DB2  (0) 2013.10.20
Trackback 0 And Comment 0
prev | 1 | next