Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select Target Dialect #9

Open
GoogleCodeExporter opened this issue Mar 14, 2015 · 0 comments
Open

Select Target Dialect #9

GoogleCodeExporter opened this issue Mar 14, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

I had to revert a database from FB2.5 Dialect 3 to FB1.5 Dialect 1.
I couldn't find any switch to do that so I took the source and hardcoded it.

It would be nice to have that switch as another option and if omited a default 
value of 3.

I've set the dialect option in here:

[code]
function TCloner.Clone(const Source, Target: TDatabase): Boolean;
...
{$IFDEF BENCH}
  Perfs.duration.Start;
{$ENDIF}

  Result := true;

  FErrorsCount := 0;

  SrcDatabase := TUIBDataBase.Create(nil);
  Source.Configure(SrcDatabase);
  SrcDatabase.Params.Add('no_garbage_collect');

  try
  {$IFDEF BENCH}
    Perfs.source_connection.Start;
  {$ENDIF}
      SrcDatabase.Connected := true;
  {$IFDEF BENCH}
    Perfs.source_connection.Stop;
  {$ENDIF}

    AddLog('Source connection'
           + #13#10 + '  Database  %s'
           + #13#10 + '  Username  %s'
           + #13#10 + '  Page Size %d'
           + #13#10 + '  Client    %s'
{$IFDEF FB102_UP}
           + #13#10 + '  Server    %s'
{$ENDIF},
      [
        Source.ConnectionString,
        Source.Username,
        SrcDatabase.InfoPageSize,
        SrcDatabase.InfoVersion
{$IFDEF FB102_UP}
       ,SrcDatabase.InfoFirebirdVersion
{$ENDIF}
      ]
    );
  except
    on E: EUIBError do
    begin
      AddLog('Cannot connect source database %s' + #13#10 +
             '%s', [Source.ConnectionString, E.Message], llError);
      Exit;
    end;
  end;

  DstDatabase := TUIBDataBase.Create(nil);
  Target.Configure(DstDatabase);
  // Hardcoded Dialect --------
  DstDatabase.SQLDialect := 1;
  // -------------------------- 
  DstDatabase.Params.Add('num_buffers=50');
...
[/code]

Original issue reported on code.google.com by [email protected] on 18 Feb 2013 at 4:05

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant