Exploring Your Database
Favorites
Within using the Database Explorer, you can define objects as being Favorites. This allows you to easily access commonly used objects.
The following sections describe how to add and organize your Favorites:
adding an object to Favorites
adding multiple objects to Favorites
defining a Schema as a Favorite
organising your Favorites
Once you have defined a number of Favorite objects, you can display them by clicking in the Favorites toolbar button. This is shown in the following screenshot.

Each Database has its own Favorites
The Favorites display can only contain objects which are part of that particular database. Each database has its own set of favorites. There is no ability for favorites to contain objects from more than one database.
Folders
You can use Folders to group your Favorites into meaningful collections. This is useful for gathering together all the objects related to a particular project or application into a single place.
An object can appear in more than one favorites folder.
The information on your Favorites is held in a file - once you have built your Favorites for a database, you can deploy it to other people in your project by sending them a copy of this file.
Favorites Displayed on Startup
You can specify that Favorites will be displayed when the Database Explorer window is opened. This is done with Options > Database Explorer > Show Favorites on startup. If there are no favorites for your database, AQT will show the normal Objects display.
Opening a particular Favorites file
You can use a particular favorites file for your database by clicking on Favorites > Open Favorites file. That file will be used for your database for this AQT session. This function is useful if you wish to use a favorites file developed for another database that has the same objects.
Adding an object to Favorites
To add an object to Favorites: from the Database Explorer
select an object (by clicking on it) and either
right click and select > Add to Favorites or
click on Favorites > Add to Favorites
or
while displaying Favorites, click on the Add button above the Favorites folders

You will be shown the following window:

You can create two types of Favorites:
a Database Object, such as a Table, Stored Procedure, Tablespace
a Query, Saved Result or a Chart
Specify the object by clicking on the Browse button ... at the right-end of the object name.
You can also:
select the Folder you want your favorite to be created in
create a new Folder. This will be created as a sub-folder within the selected folder.
enter a Description for your favorite.
for databases such as SQL Server and Sybase, you will get an option Show for all databases. When this option is checked, your Favorite object will be seen irrespective of your current database.
click on OK to add the object to your Favorites
Adding Multiple Objects to Favorites
To add multiple Database Objects to Favorites, from the Database Explorer, click on Favorites > Add Multiple Objects to Favorites.
You will be shown the following window:

To use this window:
select the objects that you want to add to Favorites.
You can select all objects with Select > All (Ctrl+A), or de-select all objects with Select > None (Ctrl+N)
(optionally) enter a description of each object
specify the folder where you want to Favorites to be created. In this folder list, the folder names are given a hierarchical name - db is the root of the Favorites folder, db\Testing is folder Testing with the root folder etc.
click on OK to add the objects.
If you wish to manipulate the objects further, use the Organise Favorites window.
Defining a Schema as a Favorite
You can define a Schema as a Favorite. The Schema can be a schema of any type of database object - tables, procedures, triggers etc. You can also define other database objects (Tablespaces, Users) as a Favorite.
When you define a Schema as a favorite, the list of objects is fetched from the database when you click on the Schema. As a result, it will always include the up-to-date list of objects. This is by contrast to normal "fixed" favorites, which are a specific list of objects. By defining Schemas as favorites you can combine both the best of both worlds between the Favorites and Objects displays.

To define a Schema as a Favorite:
click on the Schema (or other database object) in the Object Tree
click on Favorites > Add Schema to Favorites. If you are adding an object which doesn't have a schema (such as Tablespaces or Users), this menu option will have a name such as Add Tablespaces to Favorities.
you will be shown the Add to Favorites window. Select the folder for the favorite then click on OK. Note: you will not be able to enter a description for the Favorite.
Organize Favorites
To organize your Favorites, from the Database Explorer go Favorites > Organize Favorites. Alternatively, while displaying Favorites, click on the Organize button above the Favorites folders
You will be shown the following window:

Within this window you can:
delete objects from your Favorites
change the description of your objects
change the order of your objects within the folders. This is done with either the Move Up and Move Down buttons, or by dragging the objects to the new folders.
for databases such as SQL Server and Sybase, you will get an option Show for all databases. This specified whether the object will be seen irrespective of your current database.
move objects to other folders. This is done by dragging the object to the new folder.
You can also manage your Folders:
you can rename or delete folders
as with the objects, you can drag / drop your folders to new locations. You can do this to either change the order of your Folders, or to make Folders a sub-folder of another.
Click on OK to save your changes, or Cancel to exit without saving. You can also save your changes with File > Save (or Ctrl+S).
Importing and Exporting Favorites
You can export and import parts of your Favorites.
To export a Folder:
click on a folder then File > Export (or Ctrl+E).
you will be asked for the name of the export file.
you can only export the contents of a folder, or the entire favorites (by clicking on the top-most item in the favorites tree).
you can manually edit the export file to add or remove entries. The format of the export file is fices in More about Favorites.
To import some favorites:
click on the point in the favorites tree where you want the entries imported.
click on File > Import (or Ctrl+I).
AQT will check that you are not importing objects which are duplicate, or invalid in some way. If you get an error, AQT will stop the import. This may leave your favorites with a partially set of imported entries.
More about Favorites
Favorites File
The information on Favorites is held in file fav<dbname>.txt, where <dbname> is the name of your ODBC Datasource.
The Favorites files are held in the directory specified as the Default Directory for files created by AQT. If you change this directory, you should move the fav*.txt files to the new directory else they will not be found by AQT.
By default, Default Directory for files created by AQT is your AQT install directory. If you have restricted authority on your Windows system, you may not be able to create any Favorites files. In this case, change Default Directory for files created by AQT to a directory into which you are able to write files.
Layout of the Favorites and Export Files
The information in the Favorites file is held in the following format. The same format is used for Favorites Export files:
For folders:
type=node;folder=folder-name;dbs=database-name;
For objects:
type=obj;folder=folder-name;dbs=database-name;name=object-name;objtype=object-type;desc=object-description;schemaid=schema_id;objid=object_id;objid2=object_id2;
Where:
database-name is the SQL Server / Sybase database name this entry applies to.
folder-name is the folder the object is located in. This is a full path name for the folder. The top-level folder of the Favorites hierarchy is db - the first level down is db\Customer Tables etc.
For nodes, folder is the folder name itself.
object-type is the type of object. T for tables, V for views etc. The cfg file for the database gives the object-types for the database.
object-name is the name of the object
object-description is the description of the object.
schema-id, object-id, object-id2. For some databases (in particular SQL Server and Sybase), objects are identified by internal object identifiers, rather than by object names. Within the Database Explorer, these object-ids are held in hidden columns. These object-ids need to be stored in the Favorites file.
For some databases, these values can take a spurious value. These can be ignored.
isschema, query, schema, showpref. These values are used when you have defined a Schema as a favorite. They should not be changed.
Manually Adding Entries to Favorites File
You can manually add entries to the Favorites, or have entries generated automatically out of your database. If you do so, it is your responsibility not to create duplicate objects, and not to create objects in non-existent folders.
Another option is to generate an Export file and use the Import function of Organize Favorites. When these entries are imported, AQT will check that they are valid.
Deleting an Object from Favorites
This can be done in two ways:
when you are displaying favorites in the Database Explorer, go Favorites > Delete from Favorites (or Ctrl+Shift+F2).
Dropped Objects
If you drop an object, it will still be shown in Favorites. When you attempt to display the Object Details, nothing will display. You will need to manually remove the object from Favorites.
Objects which are Dropped / Redefined
For some databases, objects are referenced by an internal object-id rather than the object name. This comment applies to:
most objects for SQL Server and Sybase
DB2 Stored Procedures and Functions
The object-id is used throughout the system queries that populate the Object Details display. The object-id is held as part of the information on the object in the Favorites file.
If the object is dropped/redefined, it is generally given a new object-id. When you display the object in the Favorites display, AQT will not be able to display any information on it.
The only solution to this is to delete the object from Favorites, then add it again.
Using Administration functions
Some administration functions (such as Drop Table, Rename Table) show you a list of your objects to be processed. When you invoke this function while displaying favorites, AQT has a choice of whether to show you:
the objects which are in your favorites (eg. the same as the list you currently see in the middle grid in the Database Explorer)
all your objects within the selected schema
AQT will do one of these, depending on which is sensible for the function being performed. As a rule, the first option will be done for simple functions (such as Drop table). For more complex functions, the second option will be adopted.