We are seeing a lot of "ORA-00936: missing expression" errors in our application log. Is there a way in Oracle to determine what statement(s) are failing?
I tried querying v$sql, but these statements are not inserted into that view, since they don't pass the syntax checks.
Our C# application is using Linq to generate a query to an Oracle database. This makes it a bit difficult to get the sql query from the application. I was hoping I could just get it from Oracle easier.
You can create a trigger in Oracle that will log all errors (or pretty much all - NO_DATA_FOUND is not considered an error). In the example below, any error in the schema is recorded in the TRACK_DETAIL table (error in one row, failed SQL in the next). You can make it more sophisticated with a sequence number, date/time etc.
Remember to drop (or disable) the trigger when you have finished with it.