List:General Discussion« Previous MessageNext Message »
From:Thimble Smith Date:April 21 1999 12:46am
Subject:Re: Is there a way to know if It's a number?
View as plain text  
On Tue, Apr 20, 1999 at 08:40:14PM -0500, Benjamin Scherrey wrote:
> If its a numeric type your insert should fail for non-numeric
> data [...]

Nope.  Try it out!

    tim@envy:~$ mysql
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 2055 to server version: 3.22.20a

    Type 'help' for help.

    mysql> create table foo (num int);
    Query OK, 0 rows affected (0.08 sec)

    mysql> insert into foo (num) values ('xyz');
    Query OK, 1 row affected (0.01 sec)

    mysql> select * from foo;
    +------+
    | num  |
    +------+
    |    0 |
    +------+
    1 row in set (0.00 sec)

    mysql> 

The magic of automatic type conversion.

Tim
Thread
help! restoringpete collins19 Apr
  • Re: help! restoringChristian Mack20 Apr
    • Is there a way to know if It's a number?Jochen Haeberle20 Apr
      • Is there a way to know if It's a number?Michael Widenius21 Apr
        • Re: Is there a way to know if It's a number?Paul DuBois21 Apr
  • Re: Is there a way to know if It's a number?Benjamin Scherrey21 Apr
    • Re: Is there a way to know if It's a number?Thimble Smith21 Apr
  • Re: Is there a way to know if It's a number?Fred Read21 Apr
Re: Is there a way to know if It's a number?Christopher R. Jones21 Apr
  • Re: Is there a way to know if It's a number?Graham Ashton22 Apr