Re: Is there a function for Converting a Decimal into BINARY ?

From: "Harvey, Allan AC" <HarveyA(at)OneSteel(dot)com>
To: "Ow Mun Heng" <ow(dot)mun(dot)heng(at)wdc(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Is there a function for Converting a Decimal into BINARY ?
Date: 2009-08-28 02:03:14
Message-ID: E97A5BB7699CAD48BE2711E71247116505AAFC70@ntlmsg03.onesteel.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> Eg:
> I have a datatype in the DB which needs to be converted.
>
> DEC = 192
> BINARY = 11000000

How about this....

gwmdb=> select 192::bit(16);
bit
------------------
0000000011000000
(1 row)

Hope that helps

Allan

The material contained in this email may be confidential, privileged or copyrighted. If you are not the intended recipient, use, disclosure or copying of this information is prohibited. If you have received this document in error, please advise the sender and delete the document. Neither OneSteel nor the sender accept responsibility for any viruses contained in this email or any attachments.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2009-08-28 02:22:50 Re: Is there a function for Converting a Decimal into BINARY ?
Previous Message Ow Mun Heng 2009-08-28 01:49:03 Is there a function for Converting a Decimal into BINARY ?