Home » SQL & PL/SQL » SQL & PL/SQL » Timestamps and Hell..... (Oracle 10g)
Timestamps and Hell..... [message #346331] Mon, 08 September 2008 04:29 Go to next message
spylad
Messages: 4
Registered: June 2008
Location: Somerset, UK
Junior Member
Hi,

Just a quickie, sorry if it's been mentioned before.

I have a table full of data and one of the columns is due_date.

The due_date information is passed to the table including a timestamp. (English view DD/MM/YYY hh:mm:ss)

For a stored procedure of mine to work, I need to make sure that the due_date column does not have the timestamp....

Is there an easy way to remove it from the data?

Cheers All,

Spylad

Re: Timestamps and Hell..... [message #346338 is a reply to message #346331] Mon, 08 September 2008 04:39 Go to previous messageGo to next message
ThomasG
Messages: 3189
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
You can use the trunc function to remove the time part from the date.
Re: Timestamps and Hell..... [message #346340 is a reply to message #346331] Mon, 08 September 2008 04:46 Go to previous messageGo to next message
Littlefoot
Messages: 20891
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
spylad
English view DD/MM/YYY hh:mm:ss
./fa/1600/0/ I didn't know that people in England display months between hours and seconds. Hopefully, some of them might need to research use of proper DATE format masks; otherwise, TRUNC function might not work as intended.
Re: Timestamps and Hell..... [message #346345 is a reply to message #346331] Mon, 08 September 2008 05:22 Go to previous message
spylad
Messages: 4
Registered: June 2008
Location: Somerset, UK
Junior Member
Thanks Chaps,

I used,

update m_lincs.table_name
set due_date = trunc(due_date)

In the end....

200,000 rows... 15 seconds.

Awesome!

Cheers,
Spylad Surprised
Previous Topic: Diff b/w DD-Mon-YY and DD-Mon-RR
Next Topic: Reg dropping Queue tables ORA-24005:
Goto Forum:
  


Current Time: Sun Dec 04 08:37:17 CST 2016

Total time taken to generate the page: 0.12991 seconds