Where The Streets Have No Name

Copy_ymd 생성 본문

Developement/DataBase

Copy_ymd 생성

highheat 2006. 4. 8. 15:02
/********************************************************************

작성자 : 김대훈
작성일 : 20040206

테이블 : copy_ymd
용 도 : 일자 복제용

********************************************************************/

create table copy_ymd
(
ymd varchar2(8) not null,
ymd_dm date not null
)
tablespace users
;

insert into copy_ymd (ymd, ymd_dm)
select to_char(to_date('19591231','yyyymmdd') + rownum, 'yyyymmdd'),
to_date('19591231','yyyymmdd') + rownum
from torder
where rownum <= 36525;

alter table copy_ymd
add constraint primary key copy_ymd_idx0
;

create unique index copy_ymd_idx0 on copy_ymd
(ymd)
tablespace users
;

create unique index copy_ymd_idx1 on copy_ymd
(ymd_dm)
tablespace users
;

alter table copy_ymd
add (constraint copy_ymd_idx0 primary key (ymd) using index);

comment on table copy_ymd is '일자 복제용';
comment on column copy_ymd.ymd is '문자형 일자';
comment on column copy_ymd.ymd_dm is '일자형 일자';