"Show All" madness
-
It dices! It slices! It makes julienne fries!
-
So, a food processor for SQL? ;)
-
Python DB-APIs aren't nearly as irritating as JDBC AFAICT (but I have only worked with JDBC via its Clojure bindings...)
I've only used JDBC through Hibernate / Oracle, but one thing it seems to get right is that it errors out if you try to use comments or semicolons. How much grief would that fix / prevent if DB connectors (or the DB interfaces) just disallowed that stuff?
-
I can see both sides of the argument, but slightly prefer the warts approach: less code in the binding layer means less to debug when things don't work as expected.
Plus, the advanced / nonstandard stuff is sometimes very powerful and useful. Tradeoffs, tradeoffs...
Of course, it makes moving between DBs harder, but how often do you really do that?
QFT
-
semicolons
That bastard got me the first few times.
IME it doesn't care about comments though?
-
IME it doesn't care about comments though?
Fuck. Seriously considering logging in to test this now.
-
select 1 from dual;
ORA-00911: invalid character
select 1 from dual/*;*/
1
edit: Was logged in anyway.
-
Yes. Also, comments seem to work. Mostly. Originally I had a question mark and got errors about not enough positional parameters. I had to insert a newline to get the (line) comment to terminate (duh).
-
IIRC mysql has an option whether to allow multiple queries in one request, which is off by default? But unlike oracle it does allow the only query to be terminated with a semicolon.
Oracle does allow multiple queries in one go if they are in the form of an (anonymous) PL/SQL block. At least in the C and PHP apis, never used the java ones.