Re: CONCAT(int_col, string_col) and charset and collation problems
Hi, I know about CONVERT but I wanted to check character set of 'tt' column and this result use in CONVERT. Something like CONVERT(id USING CHARSET(Name)) which doesn't work. It wont. the syntax is -- CONVERT(expr USING transcoding_name); its the name of the transcode and not an expr. I just wonder why CONCAT(1, ',', Name) works OK even if CHARSET(1) is binary string and CONCAT(id, ',', Name) doesn't It does. mysql> select concat(1,',',tt) from test; +--+ | concat(1,',',tt) | +--+ | 1,a | | 1,b | | 1,c | +--+ 3 rows in set (0.00 sec) mysql> select concat(id,',',tt) from test; +---+ | concat(id,',',tt) | +---+ | 1,a | | 2,b | | 3,c | +---+ 3 rows in set (0.00 sec) Thanks ViSole DB Team. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: CONCAT(int_col, string_col) and charset and collation problems
I know about CONVERT but I wanted to check character set of 'tt' column and this result use in CONVERT. Something like CONVERT(id USING CHARSET(Name)) which doesn't work. I just wonder why CONCAT(1, ',', Name) works OK even if CHARSET(1) is binary string and CONCAT(id, ',', Name) doesn't Thanks, Dusan ViSolve DB Team napsal(a): Hi, It is that, what you think a binary is ,...is indeed a binary. As per the manual, If a string input or function result is a binary string, the string has no character set or collation. so the resultant 'binary' is expected. if u want the resultant as: mysql> select charset(concat(tt,CONVERT(id USING latin1))) from test; Thanks ViSolve DB Team - Original Message - From: "Dušan Pavlica" <[EMAIL PROTECTED]> To: "list mysql" Sent: Wednesday, January 31, 2007 5:31 PM Subject: CONCAT(int_col, string_col) and charset and collation problems Hi, I'm using MySQL 4.1.15, WinXP and my problem is that SELECT CHARSET(CONCAT(int_column, string_column)) FROM mytable; always returns charset 'binary' and I need resulting charset to be same as a charset of a string_column because I don't want to look for charset of a column whenever I have to call CONCAT function. Do you have any tips how to achieve it? In my opinion, results of concatenating string and numeric columns should always have charset of string column(s) and not binary charset. Thanks in advance for any response Dusan -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: CONCAT(int_col, string_col) and charset and collation problems
Hi, It is that, what you think a binary is ,...is indeed a binary. As per the manual, If a string input or function result is a binary string, the string has no character set or collation. so the resultant 'binary' is expected. if u want the resultant as: mysql> select charset(concat(tt,CONVERT(id USING latin1))) from test; Thanks ViSolve DB Team - Original Message - From: "Dušan Pavlica" <[EMAIL PROTECTED]> To: "list mysql" Sent: Wednesday, January 31, 2007 5:31 PM Subject: CONCAT(int_col, string_col) and charset and collation problems Hi, I'm using MySQL 4.1.15, WinXP and my problem is that SELECT CHARSET(CONCAT(int_column, string_column)) FROM mytable; always returns charset 'binary' and I need resulting charset to be same as a charset of a string_column because I don't want to look for charset of a column whenever I have to call CONCAT function. Do you have any tips how to achieve it? In my opinion, results of concatenating string and numeric columns should always have charset of string column(s) and not binary charset. Thanks in advance for any response Dusan -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
CONCAT(int_col, string_col) and charset and collation problems
Hi, I'm using MySQL 4.1.15, WinXP and my problem is that SELECT CHARSET(CONCAT(int_column, string_column)) FROM mytable; always returns charset 'binary' and I need resulting charset to be same as a charset of a string_column because I don't want to look for charset of a column whenever I have to call CONCAT function. Do you have any tips how to achieve it? In my opinion, results of concatenating string and numeric columns should always have charset of string column(s) and not binary charset. Thanks in advance for any response Dusan -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]