1. Prepare the data files that need to be transferred and transfer them to the server
2. Create a new target table in the database
DROP TABLE lob_tab;CREATE TABLE lob_tab ( number_content NUMBER(10), varchar2_content VARCHAR2(100), date_content DATE, clob_content CLOB, blob_content BLOB);
3. Write the control file for SQL loader (named: LOB_TEST.CTL)
LOADDATA INFILE' Lob_test_data.txt ' into TABLELob_tab Fields TERMINATED by ', '(number_contentCHAR(Ten), Varchar2_contentCHAR( -), Date_contentDATE "Dd-mon-yyyy" ":d ate_content", Clob_filename FILLERCHAR( -), Clob_content lobfile (clob_filename) TERMINATED byEOF, Blob_filename FILLERCHAR( -), Blob_content lobfile (blob_filename) TERMINATED byEOF)
It is important to note that the FileName field is defined as the filler type, which serves as the lobfile information during the transfer and does not pass into the database.
4. Use the following command to import data into the database
sqlldr userid=test/test@db10gcontrollog=lob_test.log bad=lob_test.bad
After you use the Tera term to execute the command, the import succeeds.
Test-Import LOB type data using SQL Lorader