Hu Qinan <[EMAIL PROTECTED]> wrote: > > I am wondering whether constant arguments are required in string functions, e.g. > > Substring(str, pos, len). > > Given MyTable: > ... > MyString TEXT, (muti-byte characters) > MyPos UNSIGNED(10), > MyLength UNSIGNED(10). > > While (1) works well, (2) would return strange characters. > > (1)SELECT SUBSTRING(MyString, 1, 1) > > (2) SELECT SUBSTRING(MyString, MyPos, MyLength) > FROM MyTable > > What's wrong with SQL (2)? >
The last two arguments in the SUBSTRING() must be constant. -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Egor Egorov / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net <___/ www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]