Skip to content

Select Target Dialect #9

Description

@GoogleCodeExporter
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 duiliois...@gmail.com on 18 Feb 2013 at 4:05

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions