목표 테이블의 컬럼 중 하나 (leaves_approval)는 으로 정의 된 식별 컬럼을 포함하며 항상 생성입니다.
신원 열은 2 가지 모드로 만들 수 있습니다 - 가 이 할당 할 수없는, 항상를 생성하고 이 이 할당 할 수있는 기본에 의해 생성됩니다.
원하는 경우 열 모드를 변경 한 다음 "있는 그대로"삽입 할 수 있습니다.
이것은 식별 열에 중복을 만들거나 제약 조건으로 인해 실패 할 수 있음을 고려하십시오.
ALTER TABLE leaves_approval MODIFY **my_identity_column** GENERATED BY DEFAULT AS IDENTITY;
하거나 INSERT 목록에서 ID 열을 제외 할 수 있습니다 (하지만 당신은 ID 열을 제외하고, 전체 열 목록을 표시해야합니다), 예를 들어, -
INSERT INTO leaves_approval (c1,c2,c3,c4,...)
SELECT c1,c2,c3,c4 ...
FROM requests_temp r
WHERE r.civil_number = 33322
AND r.request_id = (SELECT Max(s.request_id)
FROM requests_temp s)
Database SQL Language Reference - CREATE TABLE
ALWAYS If you specify ALWAYS, then Oracle Database always uses the sequence generator to assign a value to the column. If you attempt to explicitly assign a value to the column using INSERT or UPDATE, then an error will be returned. This is the default.
BY DEFAULT If you specify BY DEFAULT, then Oracle Database uses the sequence generator to assign a value to the column by default, but you can also explicitly assign a specified value to the column. If you specify ON NULL, then Oracle Database uses the sequence generator to assign a value to the column when a subsequent INSERT statement attempts to assign a value that evaluates to NULL.