Is there a function for Converting a Decimal into BINARY ? - Mailing list pgsql-general

From Ow Mun Heng
Subject Is there a function for Converting a Decimal into BINARY ?
Date
Msg-id D1109E8B2FB53A45BDB60F8145905CE9037D5C79@wdmyexbe03.my.asia.wdc.com
Whole thread Raw
Responses Re: Is there a function for Converting a Decimal into BINARY ?  (John R Pierce <pierce@hogranch.com>)
Re: Is there a function for Converting a Decimal into BINARY ?  ("Harvey, Allan AC" <HarveyA@OneSteel.com>)
List pgsql-general
Hi Guys,

Searching the net didn't give me much clues as to how to convert a Decimal
number into BINARY.


Eg:
I have a datatype in the DB which needs to be converted.

DEC = 192
BINARY = 11000000

DEC = 197
BINARY = 11000101

Which I then need to break down into pairs to do calculations on

11 : 00 : 00 : 00
11 : 00 : 01 : 01

Some of the solutions I've seen on the Internet is based on VB and mainly
userland apps, I would like to do the conversion within PG itself.

Thanks

pgsql-general by date:

Previous
From: Merlin Moncure
Date:
Subject: Re: Viable alternatives to SQL?
Next
From: John R Pierce
Date:
Subject: Re: Is there a function for Converting a Decimal into BINARY ?