Their is actually a programing language that has this feature.
It's called ABAP[1] and it has build in SQL Support with OpenSQL[2]. OpenSQL is just a SQL dialect which is translated to the equivalent SQL needed for the DB specific underlying DB.
Sadly ABAP is a proprietary programming language only available on the SAP Netweaver stack.