diff --git a/int.md b/int.md index 8640150efbc..c09d1cdd20d 100644 --- a/int.md +++ b/int.md @@ -20,7 +20,15 @@ In CockroachDB, the following are aliases for `INT`: ## Format -When inserting into an `INT` column, format the value as `12345`. +An `INT` column accepts numeric literals and hexadecimal-encoded numeric literals. + +### Numeric Literal + +When inserting a numeric literal into an `INT` column, format the value as `12345`. + +### Hexadecimal-Encoded Numeric Literal + +When inserting a hexadecimal-encoded numeric literal into a `INT` column, format the value as hexadecimal digits preceded by `0x`. For example, `0xcafe1111` corresponds to the numeric literal `3405648145`. ## Size diff --git a/string.md b/string.md index 10ea9788c74..3164be2f180 100644 --- a/string.md +++ b/string.md @@ -36,15 +36,19 @@ When inserting a string: ## Format -A `STRING` column accepts both string literals and escape strings. +A `STRING` column accepts Unicode string literals, hexadecimal string literals, and escape strings. ### String Literal When inserting a string literal into a `STRING` column, format the value as Unicode characters within single quotes, e.g., `'a1b2c3'`. +### Hexadecimal-Encoded String Literal + +When inserting a hexadecimal-encoded string literal into a `STRING` column, format the value as `x` or `X` followed by hexadecimal digits in single quotes. For example, `x'636174'` or `X'636174'` correspond to the Unicode string literal `'cat'`. + ### Escape String -When inserting an escape string into a `STRING` column, use either `e` or `E` and followed by one or more of the following backslash escape sequences within single quotes: +When inserting an escape string into a `STRING` column, format the value as `e` or `E` followed by one or more of the following backslash escape sequences within single quotes: Backslash Escape Sequence | Interpretation --------------------------|---------------