Applies To | |||
Product(s): | gINT Logs, gINT Professional, gINT Professional Plus | ||
Version(s): | 8 | ||
Environment: | N/A | ||
Area: | Project Database | ||
Subarea: | |||
Original Author: | Kathleen Holcomb, Bentley Technical Support Group | ||
The Tables and File menus in DATA DESIGN provides various ways to copy tables and fields from another database or external file into the current project or data template, or to copy fields from table to table. Note that these utilities just copy structures—to load external data, you would first need to create the new tables and fields with one of these methods, then import the data using File -> Import/Export in INPUT.
Many of these options are available for library tables as well.
Note: In order to perform these exercises you will need these project files: communities.bentley.com/.../import-merge-excercises.zip
The Import Table option in the Tables menu in Data Design imports a table and its fields, without data, into the current project from another project or data template. You can copy the table to the same name in the new location, or rename it.
Do the following:
Go to DATA DESIGN -> Project Database.
Select File -> Open and open simple project.gpj.
Select Tables -> Import Table. The CHOOSE A DATABASE file browser window appears.
Browse to training.gpj click Open. The Select table from dialog box appears:
In the Source table field, select ‘TESTS’.
Click OK. Notice that ‘TESTS’ now appears in the object selector, and the Fields list shows the full set of fields obtained from the TESTS table in training.gpj.
The Import Multiple Tables option in the Tables menu performs the same function as Import Table, namely to import tables and their fields, without data, from another data template or project. The advantage of Import Multiple Tables is, as you can guess, to import multiple tables at once instead of one at a time. However, you cannot rename any tables on import the way you can with Import Table.
Do the following:
Go to DATA DESIGN -> Project Database.
Select File -> Open and open simple project.GPJ.
Browse to training.gpj and click Open.
The Select One or More dialog box appears.
Notice that all tables in the source database that are not already present in the target are listed.
Click Mark All, then click OK.
Notice that the object selector now shows ‘WELL CONSTRUCTION’, and the Fields list shows the fields from that table.
This command copies fields from one table to another in the current project or data template database. This is typically used when you want to create or eliminate a table with a one-to-one relationship to another table, and move the fields from one to the other.
Do the following:
Go to DATA DESIGN -> Project Database.
Select File -> Open and open simple project.GPJ.
Go to DATA DESIGN -> Project Database.
Select File -> Open and open simple project.GPJ.
Select ‘POINT’ in the object selector.
Select Tables -> Merge Fields from Current File. The Available Tables dialog box appears.
Highlight ‘WELL DETAILS’ and click OK. The Fields to Merge dialog box appears.
Click the Mark All button, then OK. A warning message appears to tell you that only the field structures are copied, not the data. Click OK to dismiss the message.
Notice that Casing Top Elev and Casing Type are now present in the POINT table. Normally we would now copy the data into these fields in POINT, then delete the WELL DETAILS table. However, this was just for demonstration purposes, so we will delete the new fields from POINT instead.
Highlight each of these two fields in turn and click Delete.
The Merge Fields from Other File option in the Tables menu provides the only means to import field lists from external Excel, CSV, Access or AGS files. It enables the import of fields, up to the entire field list, from one table (or equivalent) in the external file to the current gINT table. Therefore, it does not enable you to import the structures of multiple tables at once, and you must create a table before importing fields into it (unless the table already exists in gINT). Also, all imported fields are created with a Type of ‘Text’, which you will need to change for fields where this is not what is desired.
To demonstrate this feature, do the following:
Go to DATA DESIGN -> Project Database.
Select File -> Open and open simple project.GPJ.
Select Tables -> New. Enter a Name of ‘GEOL’, a Key Set of ‘PointID, Depth’, and a Parent Table of ‘POINT’. Click OK.
Select Tables -> Merge Fields from Other File. A file browser window appears.
In the file browser, select a Files of Type of ‘Excel’, then browse to corresp file test data.xls. Click Open. A table selection list opens:
Select ‘GEOL’ and click OK. A field selection list appears, listing the fields in the GEOL table.
Select Mark All, then OK. Click OK to dismiss the warning message that tells you that only structures, not data, are imported.
Notice that the fields list from the external GEOL table is now present in the new GEOL table in the project.
Note that the external fields could have been added to any existing table in your project. It is not necessary to add them to a new table, although this is more convenient for the present exercise.
Select Tables -> Delete Table and click OK in the confirmation message box.
This is a powerful database tool that should be approached with a bit of caution. What it does is to import the names and properties of all unduplicated tables and fields from a source database into your current database (the source and destination can be projects, templates, or one of each). The resulting merged database contains all tables found in either the destination (current) or source database, and within each table, all fields found in either database. This provides a fast way to incorporate new tables and fields that have been added to another database.
Since the current database is updated with various new tables and fields when you run this option, you should make a backup copy of it before proceeding. Then you open the destination database in DATA DESIGN (if not currently open), select Tables -> Merge All Tables and Fields, select the source database, and click Open. The process is automatic from there.
We will not demonstrate this option.