2009年9月21日 星期一

Excel檔匯入Oracle

1. 將excel轉存為.csv
2. 建立.ctl檔
檔案內容----
load data
infile "c:\SPC_Table.csv"(資料檔名稱與路徑)
badfile "bad.log"
discardfile "discard.log"
into table SPC_TABLE(Oracle裡的Table)
fields terminated by ',' optionally enclosed by '"'(原始資料以,區格)
trailing nullcols (欄位內容)
( 零件件號
, OP
, 工令
, 日期
, 序號
, 圖號
, 值
, 操作人員
)
3. 在命令提示字元下> sqlldr userid=帳號/密碼 control=C:\SPC_Table.ctl

1 則留言:

  1. 奇怪我在pl/sql的command window中輸入
    sqlldr userid....這行命令怎會出現 2
    再按enter就沒消息了

    回覆刪除