Friday, October 28, 2011

ORACLE SQL TUTORIAL: CONVERSION FUNCTIONS


CONVERSION FUNCTIONS

Ø  Bin_to_num
Ø  Chartorowid
Ø  Rowidtochar
Ø  To_number
Ø  To_char
Ø  To_date
a) BIN_TO_NUM

     This will convert the binary value to its numerical equivalent.

     Syntax: bin_to_num( binary_bits)

     Ex:
          SQL> select bin_to_num(1,1,0) from dual;

BIN_TO_NUM(1,1,0)
------------------------
                6
Ø  If all the bits are zero then it produces zero.
Ø  If all the bits are null then it produces an error.

b) CHARTOROWID

     This will convert a character string to act like an internal oracle row identifier or rowid.

c) ROWIDTOCHAR

    This will convert an internal oracle row identifier or rowid to character string.

d) TO_NUMBER

    This will convert a char or varchar to number.

e) TO_CHAR

    This will convert a number or date to character string.

f) TO_DATE

    This will convert a number, char or varchar to a date.



0 Responses to “ORACLE SQL TUTORIAL: CONVERSION FUNCTIONS”

Post a Comment

Disclaimer

The ideas, thoughts and concepts expressed here are my own. They, in no way reflect those of my employer or any other organization/client that I am associated. The articles presented doesn't imply to any particular organization or client and are meant only for knowledge Sharing purpose. The articles can't be reproduced or copied without the Owner's knowledge or permission.