> a conscious effort to stick with a portable subset of SQL.
Or perhaps just a validation tool. Since you mentioned testing, it might even be enough to use a stripped-down parser from something like SQLite. Granted, integration could be tough if these don't already exist.
> It is much easier to have an ORM do that job for you.
> For complex applications, that is very difficult, yes.
I was hoping for more than the bare assertion. What makes it so difficult? What makes an application "complex" in this context?
> Some of the earlier Java EE ORM:s were truly garbage.
So modern ones are all (or mostly) well-written?
> For example, in C# Linq is already used for functional list processing. Using them for SQL is just a change of backend.
This sounds very much like an application developer treating the database as merely a dumb datastore, which I suspect (and I admit I'm speculating here) the OP would consider an anti-pattern.
Perhaps that's the real source of the OP's question, the perspective of someone who's well-versed enough with RDBMSes and their ability to manipulate/process data before it even reaches the application, even with only portable[1] SQL.
Hopefully the OP, or someone who responded with a "me too" to the OP can chime in to support or refute my speculation.
[1] I would expect the intersection of MSSQL, Oracle, and Postgres to be suitably powerful