Downhole Coordinates Interpolation Update
The SQL query defined in this section is used to write the results to the database.
A special type of substitution parameter can be used in the SQL script. The parameter token consists of the string “&Param” followed by a column name or a standard parameter name. At execution time, Micromine Geobank replaces the parameter token with the relevant text value. Valid parameter names are listed below:
| &ParamNewDepth | Depth at which the interpolation was done. |
| &ParamNewNorthing | Interpolated value for Northing |
| &ParamNewEasting | Interpolated value for Easting |
| &ParamNewHeight | Interpolated value for Height |
| &ParamColumnName | where ColumnName is the name of a column returned by the original survey data query |
The values for the standard parameters are generated by the depth adjustment process, while the value for a parameter of the form &ParamColumnName is retrieved from the original survey data (as returned by the main input query).
A parameter string in the form &ParamColumnName is replaced by a text representation of the value retrieved from the column ColumnName. In the case of a date field, the string returned by Micromine Geobank will be in the form specified as the “SQL Date Format” in the Micromine Geobank Database Properties Editor. In the case of a floating point value, this could result in something like “12.5999871223”. In some cases you may have to use appropriate SQL functions to reformat this value. See your database vendor documentation for more information in this regard.
The use of the special parameters is illustrated in the following SQL statement. This example comes from a process that calculates and stores the top-of-wedge coordinates for reflections that were drilled at given depths down the main hole.
INSERT INTO dbo.GB_SITE_SURVEY
(PROJECT,
SITE_ID,
INSTANCE,
RANKING,
SURVEY_TYPE,
COORDSYS,
NORTHING,
EASTING,
HEIGHT)
VALUES
('&ParamPROJECT',
'&ParamDEFLECTION',
1,
1,
'INTERP',
'&ParamCOORDSYS',
&ParamNewNorthing,
&ParamNewEasting,
&ParamNewHeight)
Once Micromine Geobank has performed the substitution, the statement will look something like the following:
INSERT INTO dbo.GB_SITE_SURVEY
(PROJECT,
SITE_ID,
INSTANCE,
RANKING,
SURVEY_TYPE,
COORDSYS,
NORTHING,
EASTING,
HEIGHT)
VALUES
('MTREEW',
'WV019-D1',
1,
1,
'INTERP',
'AMG_51S',
6285473.834,
552834.251,
539.790)
(This example is based on the assumption that there are no existing surveys for the deflections in the database.)