I work in an project that most of the code is written in PL/SQL. We need to refactor the code to support SQL Server (and if possible in the future to be database agnostic). They decided to transform the PL SQL code to ANSI SQL but for some reason it doesn't sound a good idea to me.
Can you please tell what would be the pros and cons of tranforming to ANSI instead of using an ORM?
Thanks
The problem is that pl/sql is a lot more than just sql statements. It has logic, types, objects, functions, looping and ect....
So while you could change the sql statements to be ansi compatible, there is no such animal for the procedural language.
You would need to rewrite the plsql in some sort of independent middleware language and then you're dependent on that.
Additionally, different databases handle committing changes and locking differently, so when writing code, the differences need to be understood by the developers.