Does the Oracle booklet "date" [yyyy-mm-dd] "always use the yyyy-mm-dd template?

Paraphrased, given that I am using the date as follows:

date'2010-04-10' 

can the result be only April 10, 2010 (for example, October 4, 2010)?

UPDATE I heard that you, and the documents, are talking. But...

When a batch job starts with the hard-coded date -yyyy-mm-dd ': s, it does not run for some (non-deterministic) calculations. Running failed SQL statements in PL / SQL Developer never gives the same wrong value.

Firstly, I performed the same calculations (hundreds of thousands) when the numeric date literals were replaced with the to_date ('', '') function, and everything worked fine.

Then I used NHibernate and its LINQ provider, and completely replaced SQL .... and it worked just fine ... NHibernate releases a date literal, with part time included, BTW.

UPDATE My colleague wrote code that could reproduce a bug in our environment. He posted his findings (including code) on Oracle forums: https://forums.oracle.com/forums/thread.jspa?threadID=2304569&tstart=0

UPDATE Changed the name according to the response of zerkms.

+7
source share
2 answers

This is not a function, but a date. And yes, it always matches YYYY-MM-DD regardless of the oracle settings. A.

+13
source

Here is the link to the Oracle 10g SQL link, to datetime literals . Excerpts:

The ANSI date literal does not contain a time part and must be specified in this format ('YYYY-MM-DD') . Alternatively, you can specify an Oracle date value, as in the following example:

TO_DATE('98-DEC-25 17:30','YY-MON-DD HH24:MI')

+10
source

All Articles