Install guide
OpenWorks QC/QA Queries
The QC/QA module allows the storage and execution of SQL queries against OpenWorks
projects. It differs from the stored queries in OpenWorks in that queries are ‘global’, i.e.
they are stored once without needing to be copied between projects. Multiple queries can
be run sequentially against a single project, or a single query can be run across multiple
projects. The objective is to run a series of queries that provide a project health check, e.g.
wells without KB, wells without TD etc.
Important note: The QC/QA logic as expressed in these queries may not apply to all
sites, or made need modification based on local conditions. These queries are not meant
to be universally applicable and infallible. Although a standard suite is provided, these may
be copied to a site-specific version and edited. Editing the queries as provided is not
recommended, as edits will be overwritten by subsequent WebApps updates.
Queries can be edited or added to this list by copying a .sql file to the
$OWHOME/WebApps/conf/sqlscripts directory. Files should follow a certain format to
execute properly within the browser:
Important points to note:
• The first line must contain ‘REM title:’ – this is displayed as the title in the browser.
• The second line must contain ‘REM dtype:’ – this tells the browser what to create
the hyperlink to. Currently well, wellloc (well location), field, lease, nav (line),
nav3d (survey) seismic and horizon data types are supported. Set dtype to
some other value (e.g. none) if not a simple well, well location, field, lease, navigation,
seismic or horizon query.
• Multiple optional ‘REM: description:' lines will be displayed if present, allowing
documentation of queries and any variables expected. These are also used in a
dynamically generated query description page.
• The first attribute selected must be the primary key for that data type, i.e. well_id,
well_location_id, field_id, lease_id, seis_geom_set_id,
seismic_data_set_id, horizon_attr_hdr_id. This first attribute then
appears as a hypertext link in the browser. To turn off this behavior, set dtype to
some other value, e.g. none.
• The final line must contain a ‘/’ and nothing else.
• Support for standard SQL*Plus variable substitution is provided (&varname syntax).
Variables will be displayed in the order in which they appear in the SQL.
• Support for list creation is provided for those data types that support lists: well,
field, lease, nav, nav3d and horizon.
The advantage of this format is that files can be created and tested in standard SQL*Plus
– the ‘REM’ lines are treated as remarks and ignored, and the final ‘/’ is the standard SQL
terminator. If a query parses and executes in SQL*Plus, it will usually execute in the
browser, with one exception: variable names including hyphen, period and open/close
parentheses are illegal in SQL but will work here.
WOW 5000.0.1.11 Release Notes Page 38 of 104 March 2014