Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 415
  • Last Modified:

How to create the correct date-time field?

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
GurcanK
Asked:
GurcanK
  • 3
  • 3
2 Solutions
 
Alexander Eßer [Alex140181]Software DeveloperCommented:
- Date type should/could be DATE
- for converting you may use: to_date('May 28 00:14:39', 'mon dd hh24:mi:ss')
0
 
GurcanKAuthor Commented:
How shall I define this "to_date" in create table statement?
0
 
GurcanKAuthor Commented:
In other words will external table read this field correctly with type DATE?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
Alexander Eßer [Alex140181]Software DeveloperCommented:
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
 
GurcanKAuthor Commented:
Now, that's OK thanks.
0
 
Alexander Eßer [Alex140181]Software DeveloperCommented:
You're welcome. Don't hesitate to come back in case you need further help ;-)
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now