|
|||||||||||
Tables and Table JoinsTables and Table KeysWhether you are creating a new report or modifying an existing report, your first challenge is to Figure out where your data is and how it all comes together. All your data exists in tables. Tables are linked and accessed through table keys. To reach some tables, you will need intermediate tables and table keys. Look to the tables to find the data. The location table is called OBJ_location. Condition tab data exists on the Condition table. Some instances are slightly off. One table can be linked to multiple records. For example, all your date information on the date tab lives on the Date Range table. The Date Range table holds data for the Object Table, the Activity Table, and the Lexicon Table. The object key links the date range table to the object table, the activity key links the date table to the activity table, and the Lexicon key links the date table to the lexicon table. Argus is written in table structure. The Argus database is made up of 64 tables. The tables most frequently needed by Argus users are:
How to Locate Argus Data
Table keys link tables together. You have to have matching keys. Sometimes tables need intermediate tables in order to communicate the data you need for your report. Intermediate Tables
The Party table doesn't have an object_key, so you need the Party Role table, (an intermediate table), to link the Party and Object tables.
Example: Activity-nest-credit_line. There is no direct link between Activity and Object, so an intermediate table of activy_object must be used. This is needed to print credit line in an object report. The key in the nest must be the same key as the key in the report. Note:If you are a bit confused at this point, you are not alone. Questor's table map (resident on the local drive you loaded Argus into, probably named C:\ProgramFiles\Questor\Argus\SQLany\DataModel.pdf) to learn which tables contain the fields you need, what tables they are linked to, and what keys you will need to select. You will need Acrobat Reader to read this file, but that's also resident on your local drive. TableJoinsPowerBuilder is a relational database which allows one to one relationships, one to many relationships (e.g. One object with many locations), and many to many relationships (e.g. One bibliography may be linked to many records, and each may in turn be linked to other bibliographies). Although you can view bibliographical data in the object table, it is actually held by the bibliography table. Likewise, although you add locations to object records within the object table, location information is actually indexed in the location table rather than the object table. An intermediary table , obj_location actually indexes locations linked to object records. Table joins enable Argus users to access the information apparent in one table that is actually resident in another or others. When creating a new nest, it will probably be easier to check similar nests for examples of how their joins are constructed.
Example: Object-nest appraisal_history. This has three tables: appraisal, party, and bibliography. In SQL, the red lines connect tables and the white box is how they are joined. Click on the white box between party and appraisal to see options. Argus users are only concerned with the first three options. The third option is best for us (rows from appraisal that have no party).
Joins -- How Tables Are Linked
An example of joining multiple tables would be the Activity table (which corresponds to Argus' Activity Window/Admin Tab) and Activity_Object table (which is a special intermediary table, and it corresponds to Argus's Activity Window/Object Tab and Argus' Object Window/Activity Tab). Which field - Where Tab - Tables linked by keys - exactly what field you will use from the table to link to the main table. Your retrieval argument, column and value all need to be the same - all have same keys. You're telling your nest what kinds of tables you can get into. Example: Object-nest appraisal_history. This has three tables: appraisal, party, and bibliography. In SQL, the red lines connect tables and the white box is how they are joined. Click on the white box between party and appraisal to see options. Argus users are only concerned with the first three options. The third option is best for us (rows from appraisal that have no party).
|
|||||||||||