Reputation: 4767
Is there a flag to indicate that data is of binary type, or does that need to be converted to another type. For example, is there a way to do:
INSERT INTO mytable (number) VALUES (0000 0010)
Instead of:
INSERT INTO mytable (number) VALUES (2)
I know the above is a trivial example but basically I'm wondering if you can type a binary/hex value directly into a query.
Upvotes: 1
Views: 107
Reputation: 780655
You can use a bit-value literal
INSERT INTO mytable (number) VALUES (b'00000010');
or
INSERT INTO mytable (number) VALUES (0b00000010)
Upvotes: 4