Changes

Jump to: navigation, search

PostgreSQL Adapter Project - Resources

245 bytes added, 13:00, 6 December 2010
no edit summary
: The BINARY and VARBINARY types are similar to CHAR and VARCHAR, except that they contain binary strings rather than non-binary strings. That is,they contain byte strings rather than character strings. This means that they have no character set, and sorting and comparison are based on the numeric values of the bytes in the values.(From MySQL Manual)
: In MySQL SQL syntax the function HEX() can be used to get the hexadecimal value of one field of any data-type. [http://lab.lonerunners.net/blog/binary-data-fetching-through-sqli]
: Example
<source lang = java>
CREATE TABLE mytable (testcol BINARY(16));
 
INSERT INTO mytable (testcol)
VALUES (0x013d7d16d7ad4fefb61bd95b765c8ceb);
 
SELECT hex(testcol) FROM mytable; // prints: 013d7d16d7ad4fefb61bd95b765c8ceb
 
</source>
* SQL mode
: If strict SQL mode is not enabled and you assign a value to a BINARY or VARBINARY column that exceeds the column's maximum length, the value is truncated to fit and a warning is generated.
1
edit

Navigation menu