Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

PL/SQL 101 : DataTypes - DATE

BluShadowDec 22 2015 — edited Mar 15 2023

A long awaited instalment of my PL/SQL 101 series, following on from the NUMBER datatype...

The topic for today is.... the DATE datatype...

Enjoy

[ Edited 08 Jan 2016 08:45 GMT+0 : Updated link to date functions on page 22 ]

(Edit: Now re-uploaded for new forum platform)

PLSQL 101 - DataTypes - DATE.pdf

Comments

Oracle_Monkey

Nice to put the information in the PDF .

Jagadekara

Thank you BluShadow..

Thanks for that, i have read the pdf until now and i'm learning interesting things.

Well made pdf, by the way.

Great work.

Thanks, pls keep it up with more advanced cases.

BluShadow

Thanks, pls keep it up with more advanced cases.

Any suggestions in particular?

Any suggestions in particular?

Yes, Date is really a Great Oracle datatype has date, time and time status (AM,PM).

Date counts in our Work Attendance (IN/OUT) working hours, exclude Holidays out of working hours, influence the employees excuses Many advanced date usage are required in approximately in a daily basis. Even the Overtime or the Delay has an increment or decrements in workers or employees working hours during the day,etc.

Lovely & Powerful essay u can conquer.

Amatu Allah.

Chizzle Pack

Thank you, excellent.

Frank Kulash

I especially like what it says at the top of page 14:

... we've seen some really ingenious (read that as "bad") code ...

915396

Hey Blu,

It is indeed very useful, and put up in a very concise manner. Thanks a lot!

Just one thing - from page 22 -

If you’re not familiar with the DateTime functions within Oracle, take some time to read through each of them and have a practice to really get a feel for what you can do. They’re all nicely documented:

https://docs.oracle.com/cd/B19306_01/server.102/b14200/functions001.htm#i88891

Why is the documentation link of v10.2 ? Atleast v11.2 ? Any reason in particuar... Just curious!

BluShadow

Hey Blu,

It is indeed very useful, and put up in a very concise manner. Thanks a lot!

Just one thing - from page 22 -

If you’re not familiar with the DateTime functions within Oracle, take some time to read through each of them and have a practice to really get a feel for what you can do. They’re all nicely documented:

https://docs.oracle.com/cd/B19306_01/server.102/b14200/functions001.htm#i88891

Why is the documentation link of v10.2 ? Atleast v11.2 ? Any reason in particuar... Just curious!

First link found when searching.  I'll update it when I have a moment.

BluShadow

Hey Blu,

It is indeed very useful, and put up in a very concise manner. Thanks a lot!

Just one thing - from page 22 -

If you’re not familiar with the DateTime functions within Oracle, take some time to read through each of them and have a practice to really get a feel for what you can do. They’re all nicely documented:

https://docs.oracle.com/cd/B19306_01/server.102/b14200/functions001.htm#i88891

Why is the documentation link of v10.2 ? Atleast v11.2 ? Any reason in particuar... Just curious!

I've now updated the link to the 12c documentation.

Chris Hunt

Great stuff, Blushadow. Let's hope that the people that need to read this document DO read it.

The only thing I think it's missing is some discussion of the TIMESTAMP type. You mention it in passing a couple of times, but perhaps you could add a section talking about TIMESTAMPs and when/why you might use them in preference to DATEs.

BluShadow

Great stuff, Blushadow. Let's hope that the people that need to read this document DO read it.

The only thing I think it's missing is some discussion of the TIMESTAMP type. You mention it in passing a couple of times, but perhaps you could add a section talking about TIMESTAMPs and when/why you might use them in preference to DATEs.

mainly due to time restraints and the fact I didn't want to overface people with too much additional detail.  I think it gets over the concept that the correct datatypes should be used.  Once people realise that, then they can read the documentation for the relevant datatype.

Of course, if you want to draft an additional section on what you suggest I'll be happy to add it in.

Mohammed Sardar

Hi BluShadow

Your document was very useful. You have out lots of commitment and effort.
Thanks a ton. Wishing you all the very best.

Kind Regards

Mohammed Sardar

Kalpataru

Thanks Blu

   Excellent article by you and well explained by you. I have learned a lot from this article and read about your hard work at the time of "y2k" problem.

  

Some of the question i have

-------------------------------------------

1) What was the Y2K problem ? Please describe in details.

2) What is written inside bypass_date_validation ?

BluShadow

Thanks Blu

   Excellent article by you and well explained by you. I have learned a lot from this article and read about your hard work at the time of "y2k" problem.

  

Some of the question i have

-------------------------------------------

1) What was the Y2K problem ? Please describe in details.

2) What is written inside bypass_date_validation ?

1) Google is your friend: https://en.wikipedia.org/wiki/Year_2000_problem

2) It's a function that turns raw data into a DATE datatype and returns that value.  You don't need to know the details (though you can find them on the web if you google)

EdStevens

"1) What was the Y2K problem ? Please describe in details."


As one of the legions of programmers who busted their a** for two years to prevent an Apocalypse on 1 Jan 2000, I find this question coming from a member of the IT profession to be truly frightening.  I understand that it has been 16+ years and over half of the IT community was in early adolescence (or earlier) at the time, but it is still disturbing at how fast we lose 'institutional memory'.  And we see the results of that almost daily on these very forums.

Rahul Motaparthi

"1) What was the Y2K problem ? Please describe in details."


As one of the legions of programmers who busted their a** for two years to prevent an Apocalypse on 1 Jan 2000, I find this question coming from a member of the IT profession to be truly frightening.  I understand that it has been 16+ years and over half of the IT community was in early adolescence (or earlier) at the time, but it is still disturbing at how fast we lose 'institutional memory'.  And we see the results of that almost daily on these very forums.

I was 8 years old then. The most disturbing thing, if i recall now is the 2oo0 glasses that everyone wore.

BluShadow

I was 8 years old then. The most disturbing thing, if i recall now is the 2oo0 glasses that everyone wore.

That was the new years celebrations, not the Y2K bug.  We didn't wear any special glasses to fix the bugs.

1 - 19

Post Details

Added on Dec 22 2015
19 comments
5,505 views