TO_CHAR to CHAR, TO_DATE to DATE, TO_NUMBER to NUMBER

You can’t apply a TO_CHAR() function to an argument with CHAR data type because 10-JAN-16 is already a CHAR literal.  It will generate an error

 

You can’t apply a TO_DATE() function to an argument with DATE data type because  date_of_birth is already a DATE. It will generate an  error

 

But, you can apply TO_NUMBER() function for NUMBER data type. It will work, see below.

 

You have to remember these rules. Conversion functions are tested heavily throughout the exam

One thought on “TO_CHAR to CHAR, TO_DATE to DATE, TO_NUMBER to NUMBER”

Leave a comment

Your email address will not be published. Required fields are marked *