Oracle SQL, PLSQL, APEX How To's by Dr. S. Raghunathan - HTML preview

PLEASE NOTE: This is an HTML preview only and some elements such as links or page numbers may be incorrect.
Download the book in PDF, ePub, Kindle for a complete version.

 

 

14- HOW TO CONVERT / TRANSFORM DATA

 

CONVERSION:

To-char      Transforms a DATE or NUMBER into a character        string,

To_date     Transforms  a Numberchar or varchar2 into a DATE

To_Number Transforms  char varchar2  int a

 

NUMBER,

 

One may enter the date in different ways such as

 

01-dec-2010, 01-12-2010, 2010-12-01, 12-01-2010

 

 

 

SQL EXPRESSION

RESULT

 

TO-DATE('01-DEC-2010')

'01-DEC-10

 

TO-DATE('01-12-

 

2010','DD-MM-YYYY')

 

 

 

 

We have seen some of the retrieval on selective data types like char, varchar2, number and data, Of course, the  see example ar ver illustrative  an not