Database Functions Used in EnviroInsite

<< Click to Display Table of Contents >>

Navigation:  EnviroInsite > EQuIS Database >

Database Functions Used in EnviroInsite

Standard Schema Database Functions

Geotech Schema Database Functions

Custom Functions in EnviroInsite

Header/Footer

Downhole Data

Downhole Graphic

 

 

Standard Schema Database Functions

 

EQuIS EnviroInsite calls the following standard database functions.

EQUIS.UNIT_CONVERSION

EQUIS.TO_NUMBER

EQUIS.MEASURE_DATUM

 

 

Geotech Schema Database Functions

 

EnviroInsite templates support the plotting of database functions in Boring Logs or Subsurface Profiles. EQuIS Geotech includes EnviroInsite database functions installed with the Geotechnical Schema (schema.geotech.xme) that work with EQuIS Geotech EnviroInsite templates to plot soil boring logs, Cone Penetration Test (CPT logs), Dilatometer Test (DMT) logs, well construction logs, and subsurface profiles. See the following EQuIS Geotech articles for details:

Downhole data functions

Downhole graphic functions

Header/footer data functions (scalar functions)

Header/footer graphic functions

 

 

Custom Functions in EnviroInsite

 

EnviroInsite templates support the plotting of database functions in Boring Logs or Subsurface Profiles. Functions with names starting with “ei_” will be available in the Functions tab in the right pane of the Template Design window.

 

General Requirements for all EnviroInsite Custom Functions

Custom functions must adhere to the EQuIS Database Modification Compliance Requirements.

Custom functions must be added to custom Schemas, rather than the standard ‘dbo’ or ‘equis’ schemas.

Unless instructed by EarthSoft, never overwrite or change a standard database function.

 

For more information, see Add Custom Database Objects.

 

 

Header/Footer Documentation

 

Data from SQL scalar functions may be plotted as header/footer text if configured with the following requirements:

The function meets the general requirements for all EnviroInsite custom functions.

The function name begins with "ei_".

The inputs to the function must be the FACILITY_ID followed by the SYS_LOC_CODE.

Optional inputs for TopDepthRange (real) and BottomDepthRange (real) can also be included to specify a depth range to output specific text on each page of the boring log (see example below).

The output of the function should return a formatted text string.

 

The code below is a simplified example of a compatible custom database function created in SQL Server Management Studio.

 

Click to Display Example Code

 

 

Downhole Function Documentation

 

Data from SQL table-valued functions may be plotted as boring log columns if configured with the following requirements:

The function meets the general requirements for all EnviroInsite custom functions.

The function name must begin with "ei_".

The inputs to the function must be the FACILITY_ID followed by the SYS_LOC_CODE.

The output of the function must return columns named start_depth, end_depth, depth_unit, column_header, and column_value.

 

The column_value contains the data to be plotted. If column_header is populated, it will replace the Title Text of the column (if enabled). The start_depth and end_depth columns represent the depth intervals for each column_value. The depth_unit is used for English/metric conversion if applied by the template.

 

The code below is a simplified example of a compatible custom database function. The function returns blow counts for a location, separated by dashes.

 

Click to Display Example Code

 

 

Formatting Text in Downhole Function Data

 

Parts of the text returned from the function data may be displayed as bold or underlined. This can be accomplished using the following syntax (HTML tags):

Bold – <B>Some text</B>

Underline – <UL>Some text</UL>

 

The following is an example of bold and underlined text in a boring log using the above syntax.

 

EI-Boring_Log_Downhole_Text_Example

 

 

Downhole Graphic Documentation

 

To properly configure a downhole function that returns a graphic, the function must follow these requirements:

The function meets the general requirements for all EnviroInsite custom functions.

The function name must begin with "ei_"

The inputs to the function must be the FACILITY_ID followed by the SYS_LOC_CODE.

The output of the function must return columns named start_depth, end_depth, depth_unit, column_header, and column_value.

An optional output column named column_color may also be returned. This is an integer value representing the RBG color to be used as the background color for the log interval.

The column_value of type varbinary(max) is the graphic that will be displayed on the log and should point to a Binary Large Object (BLOB)-storing field such as DT_FILE.CONTENT.

The graphic file type must be in the .DXF format.

 

The code below is a simplified example of a custom database function. In this example, the function returns a graphic associated with the DT_SAMPLE.SAMPLE_CLASS at the specified depth. This function searches the DT_FILE table for the PLACE_TYPE ‘sample_class_graphic’ and a PLACE_CODE that matches the SAMPLE_CLASS, then returns the CONTENT field as the column_value.

 

Click to Display Example Code