Hi. On Mon, Dec 10, 2001 at 05:13:21PM +0530, [EMAIL PROTECTED] wrote: > hi all, > > how can i cast a variable either from integer to varchar or varchar to > integer in mysql.
That's not possible in the way you ask for. Values will get automatically converted to the column type in question. In expressions, MySQL doesn't use "varchar", but simply string, integer and floating point. You can force a string to an integer by adding 0 (like 'SELECT "1234"+0') and an number to a string by some string functions (like 'SELECT CONCAT(10)'). I assume, there are no explicit casts, because if you want to add some number, you get the conversion implicitly by using '+'. If you could provide an example why you need explicit casts, maybe we could give a more precise answer. Bye, Benjamin. -- [EMAIL PROTECTED] --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php