Hi!
On Mon, Jul 6, 2009 at 6:45 PM, Devananda vdv<[email protected]> wrote:
> Hi all,
>
> Arjen's comment on facebook got me thinking about how much I don't like
> the LENGTH() function because it's ambiguous -- is it byte length, or char
> length? I've griped on this issue in other languages too, particularly PHP,
> and had to explain to a number of people that bytes != chars, an issue
> which is in my opinion clouded by LENGTH().
I agree.
>
> Also, I'm not a fan of the function name OCTET_LENGTH... "byte" is
> a much more commonly used term ;)
>
> So... I'm thinking of removing LENGTH() so that one must explicitly use
> BYTE_LENGTH() or CHAR_LENGTH(). What does everyone think?
(replied similarly in the other thread)
I'm not a fan of any function name - for me it's just names.
Therefore, I'd like to keep things simple, and stick to the standard.
ISO/IEC 9075-2:2003 (E)
6.27 <numeric value function>
....
<length expression> ::=
<char length expression>
| <octet length expression>
<char length expression> ::=
{ CHAR_LENGTH | CHARACTER_LENGTH } <left paren> <string value expression>
[ USING <char length units> ] <right paren>
<octet length expression> ::=
OCTET_LENGTH <left paren> <string value expression> <right paren>
The function is called OCTET_LENGTH to make it explicit that it counts
the number of 8-bit groups. Apparently, byte wasn't always
standardized on 8 bits, see:
http://en.wikipedia.org/wiki/Octet_(computing)
HTH,
kind regards,
Roland.
>
> - Devananda
>
> _______________________________________________
> Mailing list: https://launchpad.net/~drizzle-discuss
> Post to : [email protected]
> Unsubscribe : https://launchpad.net/~drizzle-discuss
> More help : https://help.launchpad.net/ListHelp
>
--
Roland Bouman
http://rpbouman.blogspot.com/
Author of "Pentaho Solutions: Business Intelligence and Data
Warehousing with Pentaho and MySQL",
http://www.wiley.com/WileyCDA/WileyTitle/productCd-0470484322.html
_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help : https://help.launchpad.net/ListHelp