FIELDS TERMINATED BY WHITESPACE & FIELDS TERMINATED BY x'09'
一、實驗環境
Windows XP+oracle9i 9.0.1
二、實驗思想
1、通過實驗對比FIELDS TERMINATED BY WHITESPACE和FIELDS TERMINATED BY x'09' 的區別
三、實驗設計
1、建立實驗表
2、建立控制檔案
3、載入資料
四、實驗步驟
1、建立實驗表
C:\Documents and Settings\Administrator>sqlplus scott/oracle
SQL> create table test3 as select * from dept where 1=2;
2、建立控制檔案
LOAD DATA
INFILE *
INTO TABLE test3
REPLACE
-- FIELDS TERMINATED BY WHITESPACE //這裡為了對比這兩者的區別,我把它定義到下面的表中
-- FIELDS TERMINATED BY x'09'
(DEPTNO TERMINATED BY WHITESPACE ,
DNAME TERMINATED BY x'09',
LOC
)
BEGINDATA
10 Sales Virginia
20 Sales Virginia
30 Sales Virginia
40 Sales "Virginia"
3、裝載資料
E:\test>sqlldr scott/oracle control=test.ctl log=test bad=test
SQL*Loader: Release 9.0.1.1.1 - Production on 星期六 8月 4 11:20:42 201
(c) Copyright 2001 Oracle Corporation. All rights reserved.
達到提交點,邏輯記錄計數3
達到提交點,邏輯記錄計數4
檢視錶中資料
SQL> select * from test3;
DEPTNO DNAME LOC
---------- -------------- ------------
20 Sales V
30 Sales V
40 Sales "
五、實驗小結
由上我們可以知道,當使用FIELDS TERMINATED BY WHITESPACE時,無論是使用空格或者tab鍵作為分隔符都能夠將記錄裝載成功;但使用FIELDS TERMINATED BY x'09'時只能以tab作為分隔符。
在做上面的實驗時loc這一列的值僅插入了一個字元,於是我做了下面這個實驗作為對比:
將控制檔案改為:
LOAD DATA
INFILE *
INTO TABLE test3
REPLACE
-- FIELDS TERMINATED BY WHITESPACE
-- FIELDS TERMINATED BY x'09'
(DEPTNO TERMINATED BY WHITESPACE ,
DNAME TERMINATED BY x'09',
LOC TERMINATED BY WHITESPACE
)
BEGINDATA
10 Sales Virginia
20 Sales Virginia
30 Sales Virginia
這時再看實驗結果:
DEPTNO DNAME LOC
SQL> select * from test3;
DEPTNO DNAME LOC
---------- -------------- -------------
20 Sales Virginia
30 Sales Virginia
40 Sales "Virginia"
發現由於我是在表被指定的分隔符,而loc這列我並沒有指定所以就預設將這列的第一個字元裝載了。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26723566/viewspace-739835/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- FIELDS TERMINATED BY WHITESPACE & FIELDS TERMINATED BY x'09' 區別
- ora-01092 oracle instance terminatedOracle
- Terminated With Error ORA-474: SMON Process Terminated With Error-1361872.1Error
- elasticsearch中使用runtime fieldsElasticsearch
- PB協議報錯 it is missing required fields: (cannot determine missing fields for lite message)協議UI
- The OracleService$$$ service terminated unexpectedly.Oracle
- JVM terminated. Exit code=1JVM
- Request Headers 的其它 fields 值Header
- SAP AET fields的自定義行為
- 升級遇到 ORA-01092: ORACLE instance terminated. Disconnection forcedOracle
- 在elasticsearch中簡單的使用script_fieldsElasticsearch
- The SQL Server (MSSQLSERVER) service terminated with service-specific error 1814 (0x716).SQLServerError
- Double-check idiom for lazy initialization of instance fields
- Reference Pivot Fields and Pivot Items in an Excel Pivot Table, using VBAExcel
- odoo ORM研究3 - odoo fields常用的欄位屬性OdooORM
- POJ 3254 Corn Fields:網格密鋪類 狀壓dp
- Spark 異常:Trying to write more fields than contained in rowSparkAI
- [Cexpert-002] How to assign default values to fields/members of a struct?Struct
- eclipse出現jvm terminated exit code=1問題[轉]EclipseJVM
- 使用建庫語句建庫時遇到ORA-01092: ORACLE instance terminated錯誤Oracle
- An Introduction to Conditional Random Fields[條件隨機場介紹]random條件隨機場
- Elasticsearch在進行聚合操作時提示Fielddata is disabled on text fields by defaultElasticsearch
- [SIP01]SIP Header Fields裡面各欄位用途Header
- idea 報錯maven [ERROR] Maven execution terminated abnormally (exit code 1)IdeaMavenErrorORM
- MRP0- Background Media Recovery terminated with error 1111Error
- sqli-labs————Less-47(procedure alalyse\lines terminated by利用)SQL
- MRP0: Background Media Recovery terminated with error 328,ORA-00328Error
- Rman-10038: Database Session For Channel D1 Terminated UnexpectedlyDatabaseSession
- ASM例項出現ORA-04031導致Instance terminated by ASMBASM
- sublime text編譯時提示錯誤[Decode error - output not utf-8] compilation terminated編譯Error
- 解決Pycharm配置R語言環境報錯RWrapper terminated, exitcode: 127PyCharmR語言APP
- python匯入資料錯誤:ParserError: Error tokenizing data. C error: Expected 1 fields in line 3, saw 2PythonError
- ANR2968E Database backup terminated. DB2 sqlcode: -2033. DB2 sqlerrmc: 106DatabaseDB2SQL
- python關於Error tokenizing data. C error: Expected 10 fields in line 30, saw 31可能出現的問題PythonError
- [羅嗦的詳解BURP靶場]徹底理解nosql最終關Lab: Exploiting NoSQL operator injection to extract unknown fieldsSQL
- 在S/4HANA擴充套件欄位的Available Fields列表裡,看不到自己建立的擴充套件欄位該怎麼辦套件AI
- undefinedfunctionopenssl_x509_readUndefinedFunction
- 用“Whitespace”程式語言編寫無字天書