Skip site navigation (1) Skip section navigation (2)

BIN()

From: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
To: Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: BIN()
Date: 2005-11-30 02:15:07
Message-ID: 438D0B2B.20507@familyhealth.com.au (view raw or flat)
Thread:
Lists: pgsql-hackers
Hi guys,

How would I go about implementing MySQL's BIN() function easily in PL/SQL.

mysql> SELECT BIN(12);
         -> '1100'

Basically it converts a bigint to a string containing 1's and 0's.

I've tried messing about with bit() types, but those types lack casts to 
text, etc.  And they are left padded with many zeros.

Any ideas?

Chris


Responses

  • Re: BIN() at 2005-11-30 02:46:13 from Andrew Dunstan
  • Re: BIN() at 2005-11-30 06:42:36 from Tino Wildenhain

pgsql-hackers by date

Next:From: Alvaro HerreraDate: 2005-11-30 02:30:50
Subject: Re: Please let us know if you will come to the PostgreSQL Anniversary
Previous:From: Josh BerkusDate: 2005-11-30 02:04:54
Subject: Please let us know if you will come to the PostgreSQL Anniversary

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group