Database 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:
Parameter | Description |
---|---|
&ParamNewCoordSys | Coordinate system code for the new (transformed) data |
&ParamNewNorthing | New value for Northing |
&ParamNewEasting | New value for Easting |
&ParamNewHeight | New value for Height |
&ParamNewConvertLog | A log showing intermediate steps in the conversion process |
&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.
The use of the special parameters is illustrated in the following SQL statement, which is based on the standard Micromine Geobank data model:
INSERT INTO DBO.GB_SITE_SURVEY
(PROJECT,
SITE_ID,
INSTANCE,
RANKING,
SURVEY_TYPE,
COORDSYS,
NORTHING,
EASTING,
HEIGHT,
CONVERT_LOG)
VALUES
('&ParamPROJECT',
'&ParamSITE_ID',
dbo.ufnNextSequenceCollarSurvey('&ParamPROJECT','&ParamSITE_ID'),
0,
'XFORMED',
'&ParamNewCoordSys',
&ParamNewNorthing,
&ParamNewEasting,
&ParamNewHeight,
'&ParamNewConvertLog')
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,
CONVERT_LOG)
VALUES
('LEOPARD',
'A152056',
dbo.ufnNextSequenceCollarSurvey('LEOPARD','A152056'),
0,
'XFORMED',
'MGA_51S',
6287588.582,
554953.778,
244.65,
'AMG_51S;AGD84;CENTRE-SHIFT;GDA94;UTM51S;MGA_51S')