?
Solved

How to create the correct date-time field?

Posted on 2014-09-16
6
Medium Priority
?
408 Views
Last Modified: 2014-09-16
Dear Experts,

I have a CSV file with a field like below:

"May 28 00:14:39","Event-001","This is error event"

I would like to load such files to an Oracle table using external tables. However I do not know which Oracle Data Type I'm going to create for the first field (which is May 28 ...) while creating table.

Note: I'll perform  insert into oracle-table select * from external-table.  

BR
0
Comment
Question by:GurcanK
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 13

Assisted Solution

by:Alexander Eßer [Alex140181]
Alexander Eßer [Alex140181] earned 2000 total points
ID: 40324784
- Date type should/could be DATE
- for converting you may use: to_date('May 28 00:14:39', 'mon dd hh24:mi:ss')
0
 

Author Comment

by:GurcanK
ID: 40324791
How shall I define this "to_date" in create table statement?
0
 

Author Comment

by:GurcanK
ID: 40324805
In other words will external table read this field correctly with type DATE?
0
Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

 
LVL 13

Accepted Solution

by:
Alexander Eßer [Alex140181] earned 2000 total points
ID: 40324808
You said, you're doing a "insert into oracle-table select * from external-table"?!
If you define  that date column upon your oracle-table then you could do "insert into oracle-table select col1, col2, col3, to_date(col4, 'mon dd hh24:mi:ss')  from external-table".
For the create table statement, regarding your oracle table, there is no need to cast with to_date function unless you do the loafding via CTAS....
0
 

Author Comment

by:GurcanK
ID: 40324813
Now, that's OK thanks.
0
 
LVL 13

Expert Comment

by:Alexander Eßer [Alex140181]
ID: 40324818
You're welcome. Don't hesitate to come back in case you need further help ;-)
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question