用SQLLOAD匯入CLOB資料
1,建立表結構
create table sqlload_test
( EMPNO number,
ENAME varCHAR2(20),
JOB varCHAR2(20),
MGR number,
SAL number,
COMM number,
DEPTNO number,
resume clob)
2,建立資料
:~> cat > ulcase91.dat <
Career Objective: Manage a sales team with consistent record breaking
performance.
Education: BA Business University of Iowa 1992
Experience: 1992-1994 - Sales Support at MicroSales Inc.
Won "Best Sales Support" award in 1993 and 1994
1994-Present - Sales Manager at MicroSales Inc.
Most sales in mid-South division for 2 years
:~> cat > ulcase92.dat <
> Career Objective: President of large computer services company
> Education: BA English Literature Bennington, 1985
> Experience: 1985-1986 - Mailroom at New World Services
> 1986-1987 - Secretary for sales management at
> New World Services
> 1988-1989 - Sales support at New World Services
> 1990-1992 - Salesman at New World Services
> 1993-1994 - Sales Manager at New World Services
> 1995 - Vice President of Sales and Marketing at
> New World Services
> 1996-Present - President of New World Services
> EOF
:~> cat > ulcase93.dat <
>Career Objective: Work as a sales support specialist for a services
>company
>Education: Plainview High School, 1996
>Experience: 1996 - Present: Mail room clerk at New World Services
>EOF
:~> cat sqldata.dat
7782,CLARK,MANAGER,7839,2572.50,,10,ulcase91.dat
7839,KING,PRESIDENT,,5500.00,,10,ulcase92.dat
7934,MILLER,CLERK,7782,920.00,,10,ulcase93.dat
3,建立控制檔案
:~> cat >sld.ctl <
> INFILE 'sqldata'
> INTO TABLE sqlload_test
> REPLACE
> FIELDS TERMINATED BY ','
> ( EMPNO INTEGER EXTERNAL,
> ENAME CHAR,
> JOB CHAR,
> MGR INTEGER EXTERNAL,
> SAL DECIMAL EXTERNAL,
> COMM DECIMAL EXTERNAL,
> DEPTNO INTEGER EXTERNAL,
> RES_FILE FILLER CHAR,
> "RESUME" LOBFILE (RES_FILE) TERMINATED BY EOF NULLIF RES_FILE = 'NONE'
> )
> EOF
:~>
4,匯入
:~> sqlldr hyf/hyf control=sld.ctl data=sqldata
SQL*Loader: Release 10.2.0.1.0 - Production on Fri Mar 28 13:30:23 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Commit point reached - logical record count 3
5,檢視日誌
:~> cat sld.log
SQL*Loader: Release 10.2.0.1.0 - Production on Fri Mar 28 13:30:23 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Control File: sld.ctl
Data File: sqldata.dat
Bad File: sqldata.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 SQLLOAD_TEST, loaded from every logical record.
Insert option in effect for this table: REPLACE
Column Name Position Len Term Encl Datatype
------------------------------ ---------- ----- ---- ---- ---------------------
EMPNO FIRST * , CHARACTER
ENAME NEXT * , CHARACTER
JOB NEXT * , CHARACTER
MGR NEXT * , CHARACTER
SAL NEXT * , CHARACTER
COMM NEXT * , CHARACTER
DEPTNO NEXT * , CHARACTER
RES_FILE NEXT * , CHARACTER
(FILLER FIELD)
"RESUME" DERIVED * EOF CHARACTER
Dynamic LOBFILE. Filename in field RES_FILE
NULL if RES_FILE = 0X4e4f4e45(character 'NONE')
Table SQLLOAD_TEST:
3 Rows successfully loaded.
0 Rows not loaded due to data errors.
0 Rows not loaded because all WHEN clauses were failed.
0 Rows not loaded because all fields were null.
Space allocated for bind array: 132096 bytes(64 rows)
Read buffer bytes: 1048576
Total logical records skipped: 0
Total logical records read: 3
Total logical records rejected: 0
Total logical records discarded: 0
Run began on Fri Mar 28 13:30:23 2008
Run ended on Fri Mar 28 13:30:24 2008
Elapsed time was: 00:00:00.28
CPU time was: 00:00:00.03
6,SQLPLUS登入進行資料驗證
SQL> select count(*) from sqlload_test;
COUNT(*)
----------
3
SQL> set long 2000
SQL> SQL> select resume from sqlload_test;
RESUME
--------------------------------------------------------------------------------
Resume for Mary Clark
Career Objective: Manage a sales team with consistent record breaking
performance.
Education: BA Business University of Iowa 1992
Experience: 1992-1994 - Sales Support at MicroSales Inc.
Won "Best Sales Support" award in 1993 and 1994
1994-Present - Sales Manager at MicroSales Inc.
Most sales in mid-South division for 2 years
esume for Monica King
RESUME
--------------------------------------------------------------------------------
Career Objective: President of large computer services company
Education: BA English Literature Bennington, 1985
Experience: 1985-1986 - Mailroom at New World Services
1986-1987 - Secretary for sales management at
New World Services
1988-1989 - Sales support at New World Services
1990-1992 - Salesman at New World Services
1993-1994 - Sales Manager at New World Services
1995 - Vice President of Sales and Marketing at
New World Services
1996-Present - President of New World Services
RESUME
--------------------------------------------------------------------------------
Resume for Dan Miller
Career Objective: Work as a sales support specialist for a services
company
Education: Plainview High School, 1996
Experience: 1996 - Present: Mail room clerk at New World Services
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/703656/viewspace-1001622/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 用Navicat把SQLServer資料匯入MySQLServerMySql
- 資料庫 MySQL 資料匯入匯出資料庫MySql
- phpMyAdmin匯入/匯出資料PHP
- Oracle資料匯入匯出Oracle
- 資料泵匯出匯入
- sqoop資料匯入匯出OOP
- Oracle 資料匯入匯出Oracle
- 大文字資料,匯入匯出到資料庫資料庫
- MySQL入門--匯出和匯入資料MySql
- MATLAB匯入資料Matlab
- 資料匯入終章:如何將HBase的資料匯入HDFS?
- Mysql 資料庫匯入與匯出MySql資料庫
- EasyPoi, Excel資料的匯入匯出Excel
- Mongodb資料的匯出與匯入MongoDB
- oracle資料匯出匯入(exp/imp)Oracle
- 匯入和匯出AWR的資料
- MySQL資料的匯入MySql
- Oracle 資料匯入ExcelOracleExcel
- mysqlimport 資料匯入程式MySqlImport
- Excel 表匯入資料Excel
- Oracle資料庫匯入匯出。imp匯入命令和exp匯出命令Oracle資料庫
- PHP大資料xlswriter匯入匯出(最優資料化)PHP大資料
- 【最佳實踐】MongoDB匯出匯入資料MongoDB
- 複雜「場景」資料匯入匯出
- ClickHouse 資料表匯出和匯入(qbit)
- 【oracle 資料匯入匯出字元問題】Oracle字元
- SQL資料庫的匯入和匯出SQL資料庫
- Oracle資料泵的匯入和匯出Oracle
- Oracle資料泵匯出匯入(expdp/impdp)Oracle
- 匯入excel 資料時間Excel
- Access 匯入 oracle 資料庫Oracle資料庫
- PHP匯入大量CSV資料PHP
- excel 匯入sqlyog資料庫ExcelSQL資料庫
- HIVE資料匯入基礎Hive
- NCF 如何匯入Excel資料Excel
- Oracle使用資料泵expdp,impdp進行資料匯出匯入Oracle
- MongoDB--Mongodb 中資料匯出與匯入MongoDB
- 匯入excel資源到資料庫Excel資料庫
- 如何將Excl內資料匯入資料庫?資料庫