ORACLE sqlldr ctl import data

Source: Internet
Author: User

ORACLE sqlldr ctl import data oracle ctl text data export import implementation (Environment oracle 9I 9.0.2) bat part (General Part) cd Y: \ 1 sqlplus mobilenew @ oral/password @ Y: \ 1 \ 6. SQL SQL part (export) set time off echo off head off; set heading offset term offset pagesize 0 set colsep ", "--- separate set trims onset feedback offset linesize 1200 spool Y: \ 1 \ character no. .txt select to_char (d. phonenumber), d. sex, d. age, d. customerstatus, d. bookstatus, to_char (d. begintime, 'yyyy-mm-dd hh24: mm: ss'), to_char (d. endtime, 'yyyy-mm-dd hh24: mm: ss'), to_char (d. ordertime, 'yyyy-mm-dd hh24: mm: ss'), d. timelength, d. callstatus, d. callbusinessid from y_customer_info d; spool off/quit/Note: The write method for the ctl import file is as follows: \ C Number import \ textC \ character code .txt 'append into table Y_CUSTOMER_INFO_TEMP_LAOLING1fields terminated by', '-- Here For comma separators to process data. trailing nullcols (PHONENUMBER, SEX, AGE, CUSTOMERSTATUS, BOOKSTATUS, BEGINTIME, ENDTIME, ORDERTIME, TIMELENGTH, CALLSTATUS, CALLBUSINESSID) excel Data Import oracle in CVS format import example: test. the ctl syntax is as follows: Load datainfile 'd:/1/1.csv 'append into table testfields terminated by', '(d,) batchcompute bat statement sqlldr userid = mobilenew/password @ orcl control = 'd: \ 1 \ test. ctl 'Log = d: \ 1 \ log.txt bad = d: \ 1 \ bad.txt csv File Import, TABLE type: date type import column child --- TABLE structure create table fjphone (ITEMNAME VARCHAR2 (50) not null, PHONENUMBER VARCHAR2 (20) not null, CITY VARCHAR2 (10) default '', AREA varchar2 (10) default '', BRAND VARCHAR2 (20) default'', JOBID VARCHAR2 (20) default '', CALLSTATS VARCHAR2 (20) default '', TIMELENGTH VARCHAR2 (20) default '', ORDERTIME date default sysdate // Time column) the ctl file is written as follows: load data infile 'e: \ 4 \ comment 'append into table fjphonefields terminated by', 'trailing NULLCOLS (ITEMNAME, PHONENUMBER, CITY, AREA, BRAND, JOBID, CALLSTATS, TIMELENGTH, ORDERTIME "to_date (: ordertime, '''yyyy-mm-dd''') ")/* Add" to_date (: ordertime, '''yyyy-mm-dd ''')"*/

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.