Oracle sqlldr 时间戳格式头疼

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1980850/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 02:19:19  来源:igfitidea点击:

Oracle sqlldr timestamp format headache

oracleformattimestampsql-loader

提问by Kevin

I'm struggling to get sqlldrto import a csv data file into my table, specifically with the field that is a timestamp.

我正在努力将sqlldrcsv 数据文件导入到我的表中,特别是对于时间戳字段。

The data in my csv file is in this format:

我的 csv 文件中的数据采用以下格式:

16-NOV-09 01.57.48.001000 PM

I've tried all manner of combinations in my control file and am going around in circles. I can't find anything online - not even the Oracle reference page that details what all the date/timestamp format strings are.

我已经在我的控制文件中尝试了各种组合,并且一直在兜兜转转。我在网上找不到任何东西 - 甚至没有详细说明所有日期/时间戳格式字符串是什么的 Oracle 参考页面。

Does anyone know where this reference page is, or what format string I should be using in my control file for this timestamp format.

有谁知道这个参考页面在哪里,或者我应该在我的控制文件中为这个时间戳格式使用什么格式字符串。

For reference, this is what I've most recently tried:

作为参考,这是我最近尝试过的:

load data
infile 'kev.csv'
into table page_hits
fields terminated by "~" 
( ...
  event_timestamp TIMESTAMP "dd-mmm-yy hh24.mi.ss", 
...)

回答by Vincent Malgrat

you can try this format:

你可以试试这个格式:

event_timestamp TIMESTAMP "dd-MON-yy hh.mi.ss.ff6 PM"

You can browse all available formats in the SQL reference documentation.

您可以在SQL 参考文档中浏览所有可用的格式。