Getting familiar with GeoData Manager
Changing how GeoData Manager looks
Scenarios for using GeoData Manager
Help with data types and nodes
w# Making ad hoc queries of the database
You can make ad hoc queries on any tables in the database. Ad hoc queries let you:
do more than you can do in GeoData Manager
do what you can already do in GeoData Manager, but do it faster.
This lets you you can change and delete parts of the database, which might delete some of your data or cause GeoData Manager to crash.
Only use this if you know what you are doing.
Before you start, back up the database.
To query an SQL server database you must have Administrator permission.
From within GeoData Manager, click Menu
in the menu bar, then click Database Administration
to display:
The left has a list of all tables in the currently-open database and the right is to type SQL queries.
After you have finished:
The formats for SQL queries for Access and SQL server differ slightly; these examples use the sample database, and so are for Access.
Here, table names are all capitals (WELL) and column names are first letters capital (Well).
Data in the database is in SI units.
Complex queries can take a long time to run.
This selects all data in the table [WELL], which is the header data of the wells. This data is displayed by GeoData Manager at the node Location and Deviation; there are 37 wells in the sample database.
In the SQL evaluation tab of the Database Administration, type the query Select * from [WELL]
and click Run SQL
.
The result of the query is displayed at the bottom. There are 37 records, as expected. The units are SI and the order is the order in the table, not any order you set in Location and Deviation.
You can also run this query by double-clicking the table name on the left.
This selects wells that have test results greater than 250 degrees C; such test results are stored in the table WELPRES. We then create a group or filter group of these wells.
Click Clear SQL
, type the query below and click Run SQL
:
There are 11 wells with measurements over 250 C.
Click Save
to store the wells as a temporary table in the database.
Now run an SQL command to add the 11 wells as a new group or filter group in the table [WELLGRP].
Note that in this case you can do the same from within GeoData Manager, because you can see all of the table WELPRES at the Reservoir or Steamfield node:
Navigate to Reservoir or Steamfield.
Click at the left of the filter bar, and click No Filter
to see all measurements in WELPRES.
Use the Detail Filter tab to select wells with measurements > 250 C: For the Detail Filter Field, select Well Temperature, click Between Limits and enter a lower limit 250 C and a high upper limit, say 2,000 C; click Apply to Detail
.
In the header window, look at each data set in turn and tag the ones that have any detail data showing.
Click at the left of the filter bar, and click Save tagged group
or Save sites to Filter Group
.
Click Clear SQL
, type the query below and click Run SQL
:
This selects the 11 wells again, and returns the well location as well as the well name.
Surfer requires a csv file, with Location E, Location N and well name. Click the to the right of Export
and click Comma Separated Value File
. Setup the export like this:
and click OK
.
Header data for a well has several columns for comments. If you decide to use a different convention for what you write in these columns, then you might want to move comments from one column to another.
Click Clear SQL
, type the query below and click Run SQL
:
Click Clear SQL
, type the query below and click Run SQL
:
Usually use Geodata Manager's Import command to import data from a file into GeoData Manager, for example, to read a spreadsheet file of downhole measurements. This becomes cumbersome if you have many data sets to enter, and in some circumstances it is possible to import many data sets at once by using ad hoc queries, which can be fast. However, to create a data set, you must add a header data record to one table and a detail data record to another table, which can be messy. Favorable circumstances to use ad hoc queries are:
If there is no detail data, or it is very simple, for example an MT sounding.
If the header data is very simple, for example an MT resistivity test.
Note that creating new data sets this way does not perform the Process, Check or Apply that you would normally do after creating or editing a data set. Therefore the new data set might have inconsistent data, and no data will have been calculated (for example if you only supply Location E then Location Lon will be empty).