MySQL Forums
Forum List  »  Connector/C++

Connector c++ 8 obtaining values from bit(1) or bit(n) fields.
Posted by: Claude Mally
Date: August 26, 2021 01:14PM

Selecting BIT(1) or BIT(N) fields from a table yields back a value that can not by printed, it's just a RAW 0 byte buffer, impossible to read.

I tried to select CAST( fieldname as char) but that does not return anything meaningful, neither in my code or in mysql shell:

mysql> SELECT name, owner, species, sex, CAST(birth as char) as casted_birth, CAST(bit as char), CAST(nibble as char) FROM pet;
+----------+-------+---------+------+---------------------+-------------------+----------------------+
| name | owner | species | sex | casted_birth | CAST(bit as char) | CAST(nibble as char) |
+----------+-------+---------+------+---------------------+-------------------+----------------------+
| Puffball | Diane | hamster | f | 1999-03-30 00:00:00 | |
|
+----------+-------+---------+------+---------------------+-------------------+----------------------+
1 row in set (0.00 sec)

mysql>


How does one use mysql c++connector to interpret BIT(N) values, please?

cma

Options: ReplyQuote


Subject
Views
Written By
Posted
Connector c++ 8 obtaining values from bit(1) or bit(n) fields.
486
August 26, 2021 01:14PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.