Home » SQL & PL/SQL » SQL & PL/SQL » Date Typecast Usage (Oracle Database 11g)
Date Typecast Usage [message #608789] Mon, 24 February 2014 20:27 Go to next message
manubatham20
Messages: 566
Registered: September 2010
Location: Seattle, WA, USA
Senior Member

Hi,

First time I saw date typecast (or I don't know) usage like below:

select 1 from dual where date '2014-02-26' > sysdate;

select to_date('26-Feb-2014','FXDD-MON-YYYY') from dual;


Could anybody give me more information on it's usage.

Manu
Re: Date Typecast Usage [message #608790 is a reply to message #608789] Mon, 24 February 2014 20:31 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>Could anybody give me more information on it's usage.

are you unwilling or incapable to simply Read The Fine Manual YOURSELF?
Re: Date Typecast Usage [message #608791 is a reply to message #608790] Mon, 24 February 2014 20:36 Go to previous messageGo to next message
manubatham20
Messages: 566
Registered: September 2010
Location: Seattle, WA, USA
Senior Member

Usage, you will never find in manual. And also when I written I don't know what it is called (i.e. date 'dd-mon-yyyy') how I can find it.
In case you aware, how it's different from regular to_date(), reply!!!

Also usage are the situations in which a particular thing should be used, I am not talking about how to use, I am talking about where and when to use.

Manu
Re: Date Typecast Usage [message #608793 is a reply to message #608791] Mon, 24 February 2014 20:46 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
http://docs.oracle.com/cd/E16655_01/server.121/e17209/sql_elements003.htm#SQLRF51063

http://docs.oracle.com/cd/E16655_01/server.121/e17209/functions213.htm#SQLRF51886
Re: Date Typecast Usage [message #608794 is a reply to message #608793] Mon, 24 February 2014 20:51 Go to previous messageGo to next message
manubatham20
Messages: 566
Registered: September 2010
Location: Seattle, WA, USA
Senior Member

Thanks, that's nice piece of information.

The ANSI date literal contains no time portion, and must be specified in the format 'YYYY-MM-DD'.
Date Literals You can specify a DATE value as a string literal, or you can convert a character or numeric value to a date value with the TO_DATE function. DATE literals are the only case in which Oracle Database accepts a TO_DATE expression in place of a string literal.

To specify a DATE value as a literal, you must use the Gregorian calendar. You can specify an ANSI literal, as shown in this example:

DATE '1998-12-25'


In second example, I don't found information for the usage and example of FX format in to_date.

Thanks mate.
Re: Date Typecast Usage [message #608795 is a reply to message #608794] Mon, 24 February 2014 20:53 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>In second example, I don't found information for the usage and example of FX format in to_date

I am sorry to see that both GOOGLE & web SEARCH are both beyond your capabilities.
Re: Date Typecast Usage [message #608796 is a reply to message #608794] Mon, 24 February 2014 20:55 Go to previous messageGo to next message
manubatham20
Messages: 566
Registered: September 2010
Location: Seattle, WA, USA
Senior Member

Hey, common BlackSwan.

I told you, I read, but I don't understand, as there was less examples, and examples I tested on my own are not giving me any fruitful result.

Here is the link what I read.

http://docs.oracle.com/cd/B19306_01/server.102/b14200/sql_elements004.htm#g195443


If you are sorry, I am really sorry to see you sorry.

Thanks.
Re: Date Typecast Usage [message #608797 is a reply to message #608796] Mon, 24 February 2014 21:00 Go to previous message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
http://docs.oracle.com/cd/E11882_01/server.112/e26088/sql_elements004.htm#SQLRF51076
Previous Topic: When I joining char and varchar2 column, I am not getting now rows
Next Topic: clob aggregation (merged)
Goto Forum:
  


Current Time: Fri Apr 19 15:04:36 CDT 2024