使用SQL * Loader控制文件将日期从一种格式转换为另一种格式 [英] Convert date from one format to another using SQL*Loader control file

查看:159
本文介绍了使用SQL * Loader控制文件将日期从一种格式转换为另一种格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

infile中的数据的格式为MM/DD/YYYY,我如何告诉控制文件以YYYYMM的形式将其加载到数据库中?

The data from the infile is in the format MM/DD/YYYY how do I tell the control file to load it into the database as YYYYMM?

推荐答案

当您在INFILE中指定列时,声明仅标识数据所采用的格式.

When you specify the columns in the INFILE declare just identify the format the data is held in. Like this

load data
infile 'whatever.csv'
into table t23
fields terminated by ','
trailing nullcols
(
       col_1    integer 
     , col_2    char 
     , col_3    date "MM/DD/YYYY"
     , col_4    date "MM/DD/YYYY"
     , col_5    char 
)

不用担心到"日期格式.那仅用于显示目的. Oracle以自己的内部表示形式存储日期.

Don't worry about the "to" date format. That is only for display purposes. Oracle stores dates in its own internal representation.

这篇关于使用SQL * Loader控制文件将日期从一种格式转换为另一种格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆