By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,619 Members | 1,712 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,619 IT Pros & Developers. It's quick & easy.

string representation of binary to integer

P: 13
Hello,

I struggle with really odd matter:
There is sth like '01010101' which is needed as an integer on function output. Is it possible to convert it (string representation of binary to integer)?
I tried ::byte and get_bytes(), without any success.

Can You help me? Thanks a lot!
pb2000
Jun 8 '11 #1
Share this Question
Share on Google+
2 Replies


Expert 100+
P: 700
try like that
Expand|Select|Wrap|Line Numbers
  1. select ('01010101'::bit(8))::integer;
  2.  
Jun 18 '11 #2

P: 1
Great! Thank you! It works in PostGreSQL.
Mar 15 '19 #3

Post your reply

Sign in to post your reply or Sign up for a free account.