This is also the idea of discovering a product that supports multiple data:
Common SQL --> (translation) Dialect SQL
Website of the product:
Http://www.swissql.com/
After downloading and installing it, there is a SwisSQLAPI. jar under the installation directory, which contains a class:
Com. adventnet. swissqlapi. SwisSQLAPI, which is the translation function.
For example:
String SQL = "select top 10 * from t order by f1 ";
SwisSQLAPI api = new SwisSQLAPI (SQL );
String db2_result = api. convert (SwisSQLAPI. DB2 );
System. out. println (db2_result );
String oracle_result = api. convert (SwisSQLAPI. ORACLE );
System. out. println (oracle_result );
String mysql_result = api. convert (SwisSQLAPI. MYSQL );
System. out. println (mysql_result );
Output:
SELECT * FROM t order by f1 fetch first 10 ROWS ONLY
SELECT * FROM (SELECT * FROM t order by f1) where rownum <11
SELECT * FROM t order by f1 LIMIT 10
Comments:
SwisSQL supports many databases, but its stability should be moderate. Some important SQL functions have incorrect translations. For example:
SELECT * FROM T1 left join T2 ON T1.ID = T2.ID
The Translation results on Sybase and ms SQL Server are obviously incorrect.
It is suggested that SwisSQL should not be tested by product applications, or be tested only by few applications.
The company has many customers, but it does not necessarily use this product for multi-database support. Instead, it serves as an auxiliary migration tool.
Chinese companies have corresponding products, and many aspects are better than SwisSQL !!