Unanswered: oracle to mysql migration and data sync
We have an application with oracle DB and now we are converting to work in mysql too. So i have re-write the query which should work in oracle and mysql also.
For Eg: oracle : select * from app where trunc(appdate)='01-Jan-2016' , MySQL : select * from app where date_format(appdate,'%d-%m-%y)='01-Jan-2016'.
Now i want to re-write the query which should be common and work in both DBs. like this way have to identify and convert for to_date and other functions too. any suggestions?.
Is your using mysql a requirement or is it because it is free. If it is the cost issue you could use https://www.postgresql.org/ instead. It is free and uses the same command syntax as oracle. If it is required then make a common function package that would have the actual commands in each database and modify your code to use the package. This would allow you to have a common code base and would only have to maintain the package for each database. And if you want to go to another database, all you would have to do is make a new version of the compatibility package.
You do not need a parachute to skydive. You only need a parachute to skydive twice.