Oracle External table import time date type data

Source: Internet
Author: User

1. Create an External table directory

Create directory extdir as 'e: appextdir ';

2. Define External tables

Create table ext_test

(

Rt date,

Rtype char (1)

)

Organization external (

Type oracle_loader

Default directory extdir

Access parameters (

Fields terminated by ',' --- the field delimiter is comma

Missing field values are null --- the end of the external file line is null

(

Rt date "YYYY-MM-DD HH24: MI: SS", --- define the time field format type

Rtype char (1) --- define other fields (multiple fields are separated by commas). The length is the same as that defined in the External table.

))

Location('test_ext.txt '));

3. Execute the query statement

SQL> select * from ext_test;

RT R

---------------

Month 1-9-12 D

02-10-12 D

September 10-12 D

23-11-12 D

20-11 months-12 D

11-1-12 D

12-6 months-12 D

25-8-12 D

7-5-12 D

08-4-12 D

10 rows have been selected.

SQL>

Note:

External file example:

Content of the test_ext.txt file:

2012-09-01, D

2012-10-02, D

2012-10-19, D

2012-11-23, D

2012-11-20, D

2012-01-11, D

2012-06-12, D

2012-08-25, D

2012-05-07, D

2012-04-08, D

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.