Oracle で、バックアップから新しいテーブルにデータをコピーしましたが、機能しません。
正しい構文は何ですか?
ありがとう
select CODE, MESSAGE into EXCEPTION_CODES (CODE, MESSAGE)
from Exception_code_tmp
エラーは
**SQL Error: ORA-00905: missing keyword
00905. 00000 - "missing keyword"**
が必要ですINSERT ... SELECT
INSERT INTO exception_codes( code, message )
SELECT code, message
FROM exception_code_tmp
データでテーブルを作成したい場合。最初にテーブルを作成します:
create table new_table as ( select * from old_table);
そして挿入
insert into new_table ( select * from old_table);
データなしでテーブルを作成する場合。使用できます:
create table new_table as ( select * from old_table where 1=0);
insert into EXCEPTION_CODES (CODE, MESSAGE)
select CODE, MESSAGE from Exception_code_tmp