Date format issues when Oracle imports files

Source: Internet
Author: User


Date format issues when Oracle imports files

Load data

InFile '/iot/opthb/tibs_home/xcx/test/loadfile.txt '

Truncate into table zhicai_record_tmp

Fields terminated by '

Trailing Nullcols (src_file_name,create_date,state_date,des_file_name)

When importing data with this template

Loadfile.txt:

Jswlwyfcg_-_01111453.20170502_-_2357+0800.ctc.dat 20170502235916 20170503000027 T_IOT_DDR_20170502.025.144.055

Jswlwyfcg_-_01111454.20170502_-_2357+0800.ctc.dat 20170502235917 20170503000027 T_IOT_DDR_20170502.025.144.056

Jswlwyfcg_-_01111455.20170502_-_2357+0800.ctc.dat 20170502235917 20170503000042 T_IOT_DDR_20170502.025.144.057

Jswlwyfcg_-_01111456.20170502_-_2357+0800.ctc.dat 20170502235917 20170503000043 T_IOT_DDR_20170502.025.144.058

Jswlwyfcg_-_01111457.20170502_-_2358+0800.ctc.dat 20170502235918 20170503000058 T_IOT_DDR_20170502.025.144.059

Jswlwyfcg_-_01111458.20170502_-_2358+0800.ctc.dat 20170503000331 20170503000347 T_IOT_DDR_20170502.025.144.075

Jswlwyfcg_-_01111459.20170502_-_2358+0800.ctc.dat 20170503000332 20170503000347 T_IOT_DDR_20170502.025.144.076

Jswlwyfcg_-_01111460.20170502_-_2359+0800.ctc.dat 20170503000332 20170503000402 T_IOT_DDR_20170502.025.144.077

Jswlwyfcg_-_01111461.20170502_-_2359+0800.ctc.dat 20170503000333 20170503000402 T_IOT_DDR_20170502.025.144.078

Jswlwyfcg_-_01111462.20170502_-_2359+0800.ctc.dat 20170503000333 20170503000416 T_IOT_DDR_20170502.025.144.079


will appear


Record 9:rejected-error on table zhicai_record_tmp, column create_date.

Ora-01861:literal does not match format string

This error, mainly because the date format does not match, this time to the imported data to format processing

Load data

InFile '/iot/opthb/tibs_home/xcx/test/loadfile.txt '

Append into table zhicai_record_tmp

Fields terminated by '

Trailing Nullcols (Src_file_name,

Create_date "To_date (: create_date, ' Yyyymmddhh24miss ')",

State_date "To_date (: create_date, ' Yyyymmddhh24miss ')",

Des_file_name)


When using this template to import data, the above error will not appear


Date format issues when Oracle imports files

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.