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

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

BIN()


  • From: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
  • To: Hackers <pgsql-hackers(at)postgresql(dot)org>
  • Subject: BIN()
  • Date: Wed, 30 Nov 2005 10:15:07 +0800
  • Message-id: <438D0B2B(dot)20507(at)familyhealth(dot)com(dot)au>

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




Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group