Following is the list and brief description of commands supported by DBMaster.
A database connection in DBMaster is defined as DBType.HostName.DBName. If you have registered a Firebird database on 10thdoorcom.easycgimysql.com called Employee then it can be referred to as Firebird.10thdoorcom.easycgimysql.com.Employee in the commands. In the descriptions below fe1 is an alias to Employee database that comes with Firebird/Interbase this will be the source database and fe2 is an alias to a new blank Firebird database this will be the target database. DBMaster has a reserved keyword called SCREEN which puts the text generated by commands in the sql window. This reserved word can be used with COPY and IMPORT commands. Just replace fe2 with SCREEN and you will get the output in a sql window.
Using DBType.HostName.DBName everytime is not so convenient. To make it
easier to work with database connection DBMaster has a feature called
database alias. You can assign a simple alias to a database and then uses it
instead of the full database name in all the commands.
Example: alias Firebird.10thdoorcom.easycgimysql.com.Employee fe1.
This command shows a list of aliases registered with DBMaster.
Example: show aliases.
This command is used to connect to a database. DBType.HostName.DBName is the
description used by DBMaster to recognize a database that has been
registered with it. DBType.HostName.DBName can be replaced with a database
Alias.
Example: connect fe1.
This command is used for looking at the data in tables. Where clause can
also be specified to limit the data you want to look at. This is done using
normal sql commands. Another IMPORTANT feature of browse command is that it
allows you to setup and view master-child relationships between tables.
Example: browse fe1.Country.
Example: browse fe1.country where country.country='USA'.
This command will open a window showing records from Country table where
Country is 'USA'.
Example: browse fe1.country join customer on customer.country =
country.country.
This command will open 2 windows one showing Country another showing
Customers. When you scroll in the window showing Country table records the
second window will show all the customers for the current country selected
in window 1.
This command copies all the UDTs/Domains from one database to another.
Example: copy udt c* from fe1 to fe2.
Example: copy udt * from fe1 to fe2.
This command deletes all the UDTs/Domains from a database.
Example: delete udt c* from fe2.
Example: delete udt * from fe2.
This command copies all the Exceptions from one database to another.
Example: copy exception c* from fe1 to fe2.
Example: copy exception * from fe1 to fe2.
This command deletes all the Exceptions from a database.
Example: delete exception c* from fe2.
Example: delete exception * from fe2.
This command copies all the Sequences/Generators from one database to
another and initializes them to the values in the source database.
Example: copy sequence c* from fe1 to fe2.
Example: copy sequence * from fe1 to fe2.
This command deletes all the Sequences/Generators from a database.
Example: delete sequence c* from fe2.
Example: delete sequence * from fe2.
This command copies all the Tables from one database to another. If the
target database has same UDTs as in the source database then UDTs are used
when creating the tables, but if the UDTs are not present in the target
database then native data type that UDTs map to are used. This command also
creates primary keys for a table in the target database.
Example: copy table c* from fe1 to fe2.
Example: copy table * from fe1 to fe2.
This command deletes all the Tables from a database.
Example: delete table c* from fe2.
Example: delete table * from fe2.
This command copies all Indices from a table in one database to
another.
Example: copy index c* from fe1.Table1 to fe2.Table1.
Example: copy index * from fe1.Table1 to fe2.Table1.
This command deletes all the indices from a table in a database.
Example: delete index c* from fe2.Table1.
Example: delete index * from fe2.Table1.
This command copies all the Indices from all the tables in one database to
another. This command can be used to copy indicies for all the tables.
Example: copy indices c* from fe1 to fe2.
Example: copy indices * from fe1 to fe2.
This command deletes all the indices from all the tables in a database.
Example: delete indices c* from fe2.
Example: delete indices * from fe2.
This command copies all the Foreign Keys from a table in one database to
another.
Example: copy foreign key c* from fe1.Table1 to fe2.Table1.
Example: copy foreign key * from fe1.Table1 to fe2.Table1.
This command deletes all the Foreign Keys from a table in a database.
Example: delete foreign key c* from fe2.Table1.
Example: delete foreign key * from fe2.Table1.
This command copies all the Foreign Keys from all the tables in one
database to another. This command can be used to copy foreign keys for all
the tables.
Example: copy foreign keys c* from fe1 to fe2.
Example: copy foreign keys * from fe1 to fe2.
This command deletes all the foreign keys from all the tables in a
database.
Example: delete foreign keys c* from fe2.
Example: delete foreign keys * from fe2.
This command copies all the Check Constraints from a table in one database
to another.
Example: copy check constraint c* from fe1.Table1 to fe2.Table1.
Example: copy check constraint * from fe1.Table1 to fe2.Table1.
This command deletes all the check constraints from a table in a
database.
Example: delete check constraint c* from fe2.Table1.
Example: delete check constraint * from fe2.Table1.
This command copies all the check constraints from all the tables in one
database to another. This command can be used to copy check constraints for
all the tables.
Example: copy check constraints c* from fe1 to fe2.
Example: copy check constraints * from fe1 to fe2.
This command deletes all the check constraints from all the tables in a
database.
Example: delete check constraints c* from fe2.
Example: delete check constraints * from fe2.
This command copies all the Views from one database to another.
Example: copy view c* from fe1 to fe2.
Example: copy view * from fe1 to fe2.
This command deletes all the Views from a database.
Example: delete view c* from fe2.
Example: delete view * from fe2.
This command is used for disconnecting from a database. All windows using
this connection are closed.
Example: disconnect fe1.
This command is used for importing data from tables in one database to
another. Where clause for each table can be specified. Where clause for a
table starts with the name of a table followed by '=' and the condition.
The condition is specified using normal sql. To add where clause for another
table separate the condition by a comma and specify the condition as
above.
Example: import table c* from fe1 to fe2.
Example: import table * from fe1 to fe2.
Example: import table c* from fe1 to fe2 where country = country='USA',
customer = Country='USA'.
This command is used for executing a sql command.
Example: run sql fe1 StoredProcedure.
This command is used for closing DBMaster. This command is useful when
running scheduled macros.
Example: shutdown.
This command is used for executing an external application.
Example: execute simple Application.Exe.
This command is used for executing an external application. DBMaster waits
for this application to finish or close before continuing.
Example: execute waiting Application.Exe.
This command is used for backing a database to a file. You need to setup the
Bin directory path in Preferences.
Example: backup fe1 to "c:\Temp\EmpBackup.fbk".
This command is used for restoring a database from a backup file. You need
to setup the Bin directory path in Preferences.
Example: restore fe1 from "c:\Temp\EmpBackup.fbk".
This command is for use inside a macro. This commands confirms with user
before executing the remaining macro.
Example: confirm macro run.
This command is used for running macros.
Example: run macro MyMacro.
Example: run macro MyMacro SrcDB=fe1 DesDB=fe2.