固定幅のテキストファイルをインポートしようとしていますが、ASCII以外のcharaterデータに問題があります。以下は問題を示す最小の例です。ここで UTF8でエンコードされた固定幅のテキストファイルをSQLローダーで読み込み
load data
infile *
truncate into table test
(
txt position(1:3)
)
BEGINDATA
A
Ö
ABC
ÅÄÖ
はテーブルです:
create table test(
txt varchar2(30 char) not null
);
すべてのレコードが、最後のものはうまくインポートされます。私はそれがバイト対文字セマンティクスと関係していると思います。この修正可能なのは私の最後ですか? マルチバイト文字データを含むファイルで固定幅レコードについて話すことも可能ですか? SQL-ロードの問題は、あなたが特定のフィールドサイズを期待して一定の幅とアプリケーションを期待しての間で発生する可能性が
SQL*Loader: Release 11.2.0.1.0 - Production on Mon May 29 10:30:04 2017
Control File: test.dat
Data File: test.dat
Bad File: test.bad
Discard File: none specified
(Allow all discards)
Number to load: ALL
Number to skip: 0
Errors allowed: 50
Bind array: 64 rows, maximum of 256000 bytes
Continuation: none specified
Path used: Conventional
Table TEST, loaded from every logical record.
Insert option in effect for this table: TRUNCATE
Column Name Position Len Term Encl Datatype
------------------------------ ---------- ----- ---- ---- ---------------------
TXT 1:3 3 CHARACTER
Record 4: Rejected - Error on table TEST, column TXT.
Multibyte character error.
Table TEST:
3 Rows successfully loaded.
1 Row not loaded due to data errors.
Space allocated for bind array: 384 bytes(64 rows)
Read buffer bytes: 1048576
Total logical records skipped: 0
Total logical records read: 4
Total logical records rejected: 1
Total logical records discarded: 0
これは答えではありません。あなたはその例を試しましたか? – Ronnis
hmmあなたはtxt POSITION(1:9)CHAR – sandman
のようなものを試しましたが、NLS_LANGがUTF8またはOSのロケールに設定されているので、Oracleが必要なマルチパス変換を行うことができます – sandman