1

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.

0

1 Answer 1

4

You can use a bit-value literal

INSERT INTO mytable (number) VALUES (b'00000010');
or
INSERT INTO mytable (number) VALUES (0b00000010)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.