Infolinks

Saturday 12 May 2012

SQL-FUNCTIONS1(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.

No comments:

Post a Comment