Convert Delphi Interbase Sql to Sql Server and Oracle

I have a delphi application that uses the interbase / firebird database. To consult and write data, I use InterBase Component Panels (IBTable, IBQuery, IBDataset). I'm converting my system to sqlserver / Oracle, but I have thousands of queries that are collected at runtime with SQL statements InterBase / Firebird database specification. Does anyone know any component or tool that makes Parse Interbase -> SQL Server or Interbase-> Oracle commands?

what i need is something like:

Var
  Parser: TParser;
  OutputSql: String;
Begin
   Parser := TParser.Create();
   Parser.Text := 'SELECT FIRST 10 CITYNAME FROM TBCITY';

   if Firebird then
      OutPutSql := Parser.ParseTo('SQLSERVER');

   if Oracle then
      OutPutSql := Parser.ParseTo('ORACLE');

   ComponentAccess.Sql.Text := OutPutSql;
   ...

Result:

Parser.ParseTo('SQLSERVER');

Will be

'CHOOSE TOP 10 CITIES FROM TEXT'

and

Parser.ParseTo('ORACLE');

Will be

'CHOOSE FAMILY FROM TEXT WHERE ROWNUM <= 10'

+3
3

1) AFAIK, AnyDAC, SQL. , SQL.

2) SQL , :

if Firebird then
  SQL.Add(...)
else if Oracle then
  SQL.Add(...)
...
+3

AnyDAC. LIMIT:

ADQuery1.Sql.Text := 'SELECT {LIMIT(10)} CITYNAME FROM TBCITY';

AnyDAC .

+2

kbmMW Components4Developers , .. // , /. Devart - - SQL Server. , , , SQL . , , , .

@oodesigner, , $ifdef SQL const.

{$ifdef USE_MSSQL}
  QUERY_ONE = 'select blah blah blah...';
{$else}
  QUERY_ONE = 'select nah nah nah...';
{$endif}

Then in the main block a simple assignment

SQL.Text := QUERY_ONE;

or

SQL.Text := Format(QUERY_TWO, [some_very_carefully_quoted_stuff_or_use_params]);

I do not know anything that could automate or analyze it. And the problem is that you still need to go through and check each individual request, because it is too easy to make a mistake when converting.

0
source

Source: https://habr.com/ru/post/1768342/


All Articles