<< ibec_CompareTables | IBEBlock | ibec_ExtractMetadata >>

ibec_CompareMetadata

Compares the metadata of specified databases and creates a script of all discrepancies.

Syntax

 function ibec_CompareMetadata(MasterDB : variant; SubscriberDB :variant;
    ScriptFile : string; Options : string;
    CallbackBlock : variant) : string;

Description

This function compares the metadata of two databases (or scripts) and creates a discrepancy script.

Parameters

MasterDBReference database or script file.
SubscriberDBComparative database or script file.
ScriptFileName of the difference script file.
OptionsList of options, delimited with semicolon; possible options are:
OmitDomains(Domains=0) don't compare domains.
OmitTables(Tables=0) don't compare tables.
OmitViews(Views=0) don't compare views.
OmitTriggers(Triggers=0) don't compare triggers.
OmitProcedures(Procedures=0) don't compare procedures.
OmitGenerators(Generators=0 don't compare generators.
OmitExceptions(Exceptions=0) don't compare exceptions.
OmitUDFs(UDFs=0) don't compare UDFs.
OmitRoles(Roles=0) don't compare roles.
OmitIndices(Indices=0) don't compare indices.
OmitGrants(Grants=0) don't compare privileges.
OmitUserGrants(UserGrants=0) don't compare user privileges.
OmitRoleGrants(RoleGrants=0) don't compare role privileges.
OmitObjectGrants(ObjectGrants=0) don't compare database object privileges.
OmitDescriptions(Descriprions=0) don't compare object descriptions.
OmitPrimaryKeys(PrimaryKeys=0) don't compare primary keys.
OmitForeignKeys(ForeignKeys=0) don't compare foreign keys.
OmitUniques(Uniques=0) don't compare unique constraints.
OmitChecks(Checks=0) don't compare check constraints.
OmitFunctionsNew to IBExpert version 2015.09.28. Skips stored functions while extracting and comparing metadata.
OmitPackages New to IBExpert version 2015.09.28. Skips packages while extracting and comparing metadata.
SafeDatatypeConversion(SafeDatatypeConversion=1) Use only safe data type conversion (don't update system tables directly).
IgnoreColumnPositionsdon't compare column positions.
IgnoreIBEObjectsdon't compare IBE$xxx objects
IgnoreCharsetsWhen specified, character sets of domain/fields/parameters will be ignored during the comparison process.
ServerVersionPossible values are:
IB4x - for InterBase 4.x;
IB5x - for InterBase 5.x;
IB6x - for InterBase 6.x;
IB7x - for InterBase 7.x;
IB75 - for InterBase 7.5;
FB1x - for Firebird 1.x;
FB15 - for Firebird 1.5;
FB20 - for Firebird 2.0;
FB21 - for Firebird 2.1;
FB25 - for Firebird 2.5;
FB30 - for Firebird 3.0; (since IBExpert version 2015.09.28)
YA1x - for Yaffil 1.x.
If the ServerVersion is not specified, FB15 will be used.
CallbackBlockA callback IBEBlock which will be executed for each record processed whilst comparing data. The callback IBEBlock must have at least one input parameter, which will be used to pass a number of processed records within it.

Examples of usage

1. Comparing databases:

   execute ibeblock
   as
   begin
      create connection MasterDB dbname 'localhost:c:\MasterDB.fdb'
      password 'masterkey' user 'SYSDBA'
      clientlib 'C:\Program Files\Firebird\bin\fbclient.dll';

      create connection SubscriberDB dbname 'localhost:c:\SubscriberDB.fdb'
      password 'masterkey' user 'SYSDBA'
      sql_dialect 3
      clientlib 'C:\Program Files\Firebird\bin\fbclient.dll';


      cbb = 'execute ibeblock (LogMessage variant)
             as
             begin
               ibec_progress(LogMessage);
             end';

      ibec_CompareMetadata(MasterDB, SubscriberDB, 'E:\CompRes.sql', 'OmitDescriptions; OmitGrants', cbb);

      close connection MasterDB;
      close connection SubscriberDB;
   end

2. Comparing scripts:

   execute ibeblock
   as
   begin
     cbb = 'execute ibeblock (LogMessage variant)
            as
            begin
              ibec_progress(LogMessage);
            end';

     ibec_CompareMetadata('c:\myscripts\master.sql','c:\myscripts\subscriber.sql', 'E:\CompRes.sql','', cbb);
   end

3. Using the ServerVersion parameter:

   ibec_CompareMetadata(MasterDB, 
                        SubscriberDB, 
                        'E:\CompRes.sql', 
                        'OmitDescriptions; OmitGrants; ServerVersion=FB1х', 
                        cbb);

See also:
Comparing databases using IBEBlock
Comparing scripts with IBEBlock
Extract metadata using IBEBlock
IBEBlocks

back to top of page
<< ibec_CompareTables | IBEBlock | ibec_ExtractMetadata >>