0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

SQL*Loaderでboolean型を数値型へ変換する制御ファイルの書き方

Posted at

制御ファイルサンプル

制御ファイル
OPTIONS (
   SKIP=1,
   ERRORS=-1,
   ROWS=10000)
LOAD DATA
   CHARACTERSET JA16SJIS
   INFILE 'data.CSV'
   TRUNCATE 
   INTO TABLE TABLE_NAME 
   FIELDS TERMINATED BY","OPTIONALLY ENCLOSED BY'"'TRAILING NULLCOLS 
(
   id,
   name,
   flg "decode(:flg,'True',1,'False',0,NULL)",
)

ポイント

下記行がポイント。decodeで変換する
"decode(:flg,'True',1,'False',0,NULL)",

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?