Reading timestamps when importing data in SQL Developer

百般思念 提交于 2020-01-05 08:45:14

问题


I am trying to read a text file into an Oracle database using the Data Import Wizard in SQL Developer.

I am stuck on step 5 because I cannot get the Verify parameters before import to succeed on my timestamp fields.

Going back to step 4, I have tried changing the Data type of my timestamp fields to Timestamp, Timestamp with time zone, and Timestamp with local time zone. In desperation, I even tried Date. Nothing worked.

I then noticed the Format field that shows up when you select any of the Timestamp... or Date types for the "Data Type" field. So, I tried specifying the format for my data, an example of which follows: 01/03/2008 06:25:00 AM -0500.

Not sure what the proper codes are for the format and finding no documentation online, offline, or in my head, I tried all of the following formats to no avail: MM/DD/YYYY HH:mm:SS AM +0000; MM/DD/YYYY HH:mi:SS AM +0000; MM/DD/YYYY HH12:mm:SS AM +0000; mm/dd/yyyy hh:mm:ss AM +0000.

In further desperation, I have tried many, many combinations of the various encodings for each of the sub-elements of the timestamp: MM and mm for month, DD and dd for day, YYYY and yyyy for year, HH and hh and HH12 for hour, mm and mi for minute, SS and ss for second, and lots of crazy stuff for the AM/PM and time zone fields. Nothing has worked.

So, stackoverflow patrons, I ask for your help. I have tried searching for a solution to this problem and I have tried lots of different solutions on my own. I have done my best, but my best hasn't been good enough on this problem. Help me Obi Wan; you're my only hope.


回答1:


You probably want the date/time format:

MM/DD/YYYY HH12:MI:SS AM TZHTZM

And this is the date format documentation.

And you'll need to selet a data type with timezone.



来源:https://stackoverflow.com/questions/13938050/reading-timestamps-when-importing-data-in-sql-developer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!