Fix SQL requests on Oracle and SQLServer