× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On 16-Jun-2015 18:46 -0600, CRPence wrote:
<<SNIP>> I forgot to specify the length attribute for the BINARY
typing on the casting scalar, so the default size is for a 1-byte
value :-( The revision:

INSERT INTO test_file (BAR) VALUES( CAST('08 Bytes' as BINARY(8)) )

BTW, using one of the data-type casting scalars BINARY() and VARBINARY() rather than the more generic CAST() casting scalar function allows omitting the length specification, because the length is determined from the string rather than expected\inferred from the typing rules for CREATE TABLE; e.g. either of the following statements instead of the above INSERT should function as well, and more generically:

INSERT INTO test_file (BAR) VALUES( BINARY('08 Bytes') )

INSERT INTO test_file (BAR) VALUES( VARBINARY('08 Bytes') )


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.