That's quite legal. Most SQL implementations use the semi-colon to delimit multiple SQL statments on a single line. The following should work just fine on most SQL implementations.
$dbh->do('update bar set attr=val;delete from baz;');
They are also required when using most native user interfaces as those don't have a line-continuation character. Consider:
SELECT *
FROM tab1, tab2
WHERE tab1.x = tab2.y
ORDER BY tab1.x desc; <-- this tells the interface you're ready to pro
+cess
That's alot nicer to read than one long sting. However, DBI's prepare adds the semi-colon if you don't.
Then you have those crazy Sybase folks that want you to type 'go' instead of a semi-colon. . . sheeesh!
At least Microsoft did one thing right when they assimilated that code! |