Home Privacy Policy Feedback Link to us Site Map Forums

Oracle/PLSQL: Bin_To_Num Function


In Oracle/PLSQL, the bin_to_num function converts a bit vector to a number.

The syntax for the bin_to_num function is:

bin_to_num( expr1, expr2, ... expr_n)

expr1, expr2, ... expr_n must be either 0 or 1 values. They represent bits in a bit vector.


Applies To:

  • Oracle 9i, Oracle 10g, Oracle 11g

For example:

bin_to_num(1) would return 1
bin_to_num(1,0) would return 2
bin_to_num(1,1) would return 3
bin_to_num(1,1,1,0) would return 14
bin_to_num(1,1,1,1) would return 15