임시 테이블 만드려고합니다. 데이터유형문제 0 6 624

by 켠서 [2019.08.13 14:53:53]


안녕하세요. ms sql 버전을 oracle버전으로 코딩변환작업을 하고있습니다.

다음 내용은 데이터 유형이 적합하지 않다고 뜨는데용, 어떻게 하면 좋을가요??

 

create global temporary table cohort_cdm.VISIT_OCCURRENCE
(
    visit_occurrence_id    bigint primary key,
    person_id integer not null,
    visit_concept_id integer not null,
    visit_start_date date not null,
    visit_start_time time,
    visit_end_date date not null,
    visit_end_time time,
    visit_type_concept_id integer not null,
    provider_id integer,
    care_site_id integer,
    visit_source_value varchar(50),
    visit_source_concept_id    integer
)
on commit preserve rows;

by 꼬랑지 [2019.08.13 16:51:57]

MSSQL과  ORACLE은 데이타 타입이 달라요

오라클은 BIGINT, INTEGER 이런 데이타 타입 없습니다.

[MSSQL ORACLE 데이타타입] 이런 제목으로 검색해서 변경하셔야 합니다.


by 생각 [2019.08.13 17:22:29]

오라클은 INTEGER 형은 NUMBER 를 씁니다.


by 켠서 [2019.08.14 09:18:21]

create global temporary table cohort_cdm.VISIT_OCCURRENCE
(
    visit_occurrence_id    bigint primary key,
    person_id number not null,
    visit_concept_id number not null,
    visit_start_date date not null,
    visit_start_time time,
    visit_end_date date not null,
    visit_end_time time,
    visit_type_concept_id number not null,
    provider_id number,
    care_site_id number,
    visit_source_value varchar(50),
    visit_source_concept_id    number
)
on commit preserve rows;

이렇게 바꿔도 데이터 유형이 부적합하다고 뜨네요.ㅠ.ㅠ


by jkson [2019.08.14 09:44:36]

create global temporary table cohort_cdm.VISIT_OCCURRENCE
(
    visit_occurrence_id    number primary key,
    person_id number not null,
    visit_concept_id number not null,
    visit_start_date date not null,
    visit_start_time date,
    visit_end_date date not null,
    visit_end_time date,
    visit_type_concept_id number not null,
    provider_id number,
    care_site_id number,
    visit_source_value varchar(50),
    visit_source_concept_id    number
)
on commit preserve rows;


by 켠서 [2019.08.14 14:08:01]

jkson님 정말감사합니다.~


by 마농 [2019.08.16 07:37:38]

오라클은 time 형이 없습니다.
date 항목과 time 항목을 하나로 합쳐서 date 로 선언하셔야 할 듯 하네요.

댓글등록
SQL문을 포맷에 맞게(깔끔하게) 등록하려면 code() 버튼을 클릭하여 작성 하시면 됩니다.
로그인 사용자만 댓글을 작성 할 수 있습니다. 로그인, 회원가입