Quantcast
Channel: MySQL Forums - Connector/C++
Viewing all articles
Browse latest Browse all 527

Connector c++ 8 obtaining values from bit(1) or bit(n) fields. (no replies)

$
0
0
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?

Viewing all articles
Browse latest Browse all 527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>