Hello,
Is there a way to do addition and subtraction on BIT types? For example,
for
creat table test (a BIT(3));
insert into test values (B'101');
select a + 1 from test; fails
and select a::smallint + 1 from test; also fails.
In addition, is there a way to change the bit of a bit string? For
l be doing a lot bit manipulation.
Thanks,
Yasir
On Sun, 16 Nov 2003, Stephan Szabo wrote:
> Date: Sun, 16 Nov 2003 21:40:45 -0800 (PST)
> From: Stephan Szabo <[EMAIL PROTECTED]>
> To: Yasir Malik <[EMAIL PROTECTED]>
> Cc: [EMAIL PROTECTED]
> Subject: Re: [SQL] Addition and
On Mon, 17 Nov 2003, Yasir Malik wrote:
> Thank you for your reply.
> select int4(b'1001')::bit(32); gives the same result as what you gave.
> select int4(b'1001')::bit(4); gives the upper four bits, which are all
> zeroes. How would I get the lower four bits? I building bitmaps using
> plpgsql,
l be doing a lot bit manipulation.
Thanks,
Yasir
On Sun, 16 Nov 2003, Stephan Szabo wrote:
> Date: Sun, 16 Nov 2003 21:40:45 -0800 (PST)
> From: Stephan Szabo <[EMAIL PROTECTED]>
> To: Yasir Malik <[EMAIL PROTECTED]>
> Cc: [EMAIL PROTECTED]
> Subject: Re: [SQL] Addition and
On Sun, 16 Nov 2003, Yasir Malik wrote:
> I think I am almost at a solution to my last question. I can do
> select int4(a) from test;
> to convert to an integer. So now addition and
> subtraction can be done between bit types. But how do I convert back to
> BIT type? If I do
> select bit(int4(
Hello,
I think I am almost at a solution to my last question. I can do
select int4(a) from test;
to convert to an integer. So now addition and
subtraction can be done between bit types. But how do I convert back to
BIT type? If I do
select bit(int4(b'1001'));
I get the following message:
ERROR
Hello,
Is there a way to do addition and subtraction on BIT types? For example,
for
creat table test (a BIT(3));
insert into test values (B'101');
select a + 1 from test; fails
and select a::smallint + 1 from test; also fails.
In addition, is there a way to change the bit of a bit string? For