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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-hackers by date

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