Hi,
> I see two reasons why this is not appropriate:
> 1) unclear why to convert 'a' to int rather then 1 to varchar
Correct, and because it's unclear it should throw an error.
> 2) other databases (I checked mysql) run such a statement without
> error
That is the only one which accepts that.
All others I have tested (Postgres, Oracle, SQL Server, Firebird, DB2)
throw an error message.
What is even more critical with MySQL that it tries to guess what you
mean when doing implicit conversion.
Run this in MySQL (the storage engine does not matter), and be
surprised about the result:
CREATE TABLE temp_str
(
str VARCHAR(64)
)
;
INSERT INTO temp_str (str) VALUES
('22 West End'),
('22.123.29.90'),
('22 West End'),
('100 East End'),
('300 East End'),
('200 North End'),
(123455)
;
select * from temp_str where str = 2;
select * from temp_str where str = 22;
select * from temp_str where str = 22.;
select * from temp_str where str = 22.123;
select * from temp_str where str = 123455;
select * from temp_str where str = 100;
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/h2-database?hl=en
-~----------~----~----~----~------~----~------~--~---