HI!

>> SELECT * FROM t1 WHERE c1 IN ("alpha", "beta", "gamma", )

>> Some programming languages (python) already work this way,
>> very handy, try to belive.

Add PHP, many others IIRC.

> I'm strongly of the opinion that this is and should remain a syntax error.
> Now, if you would argue that the error message for this is less than
> helpful, I'd whole-heartedly agree :)

+1

SQL is often the result of code-generation, whereas Python/PHP are
"usually" not.
Let me reproduce (at least what I think Kay's comment is), but in php code:

<?php

/* Pretend this list of integers comes from
some other code above - the last empty string is a bug */

$integers = array('1', '2', '3', '6', '9', '');

mysql_query("SELECT * from blog_posts WHERE id IN (".implode(",",
$integers).")");

?>

(There's some other problems with the code - but temporarily ignore
them please).

- Morgan

_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help   : https://help.launchpad.net/ListHelp

Reply via email to